Hacker News

Top stories

Live mirror
30 storiesupdated just nowView source snapshot
  1. F-Droid 2.0 (f-droid.org)
    280comments
  2. Show HN: Make cursed fonts like Times New Bastard (mitpit.com)
    78comments
  3. Show HN: Whiteboard (YC W26) – An open-source IDE for thoughtful software design (github.com/devdotfast)
    92comments
  4. Why is the liver so weirdly regenerative? (dynomight.substack.com)
    170comments
  5. 2DWillNeverDie (2dwillneverdie.com)
    19comments
  6. Fearless SIMD v1.0 (linebender.org)
    33comments
  7. Rails World 2026 Opening Keynote [video] (youtube.com)
    299comments
  8. Toyota is taking the Corolla electric (electrek.co)
    439comments
  9. My weird new hobby: Wandering around Tokyo on Google Maps (ahmedhossamdev.com)
    110comments
  10. Using LLMs to trace alchemical knowledge and decode 17th century letters (resobscura.substack.com)
    14comments
  11. Google’s Project Suncatcher to put ML infrastructure in space (blog.google)
    261comments
  12. Writing Parquet files using Haskell (datahaskell.org)
    2comments
  13. Two-tier encryption in the UK (macanorak.com)
    384comments
  14. Book review: Is parallel programming hard, and, if so, what can you do about it? (ahelwer.ca)
    30comments
  15. The Board Game of the Alpha Nerds (2014) (grantland.com)
    26comments
  16. Show HN: Air-gapped file encryption as self-decrypting HTML page (apeleg.com)
    16comments
  17. California is chasing wealth that has feet (landeconomics.org)
    518comments
  18. The Bayeux Tapestry: Woven by the Victors (historytoday.com)
    1comments
  19. Sourcehut account takeover via build logs (XSS in ansi2html) (blog.arusekk.pl)
    14comments
  20. Security auditing in the age of (good enough) AI (trailofbits.com)
    8comments
  21. Show HN: Koi.rest – watch some fish and regain your balance (koi.rest)
    38comments
  22. Opus 5.5 is good at explainer videos (launchvideo.io)
    101comments
  23. The forgotten battle of East Lansing (eastlansinginfo.news)
    15comments
  24. Forging 1024-bit RSA signatures in nearly SNFS time [pdf] (iacr.org)
    9comments
  25. Geothermal heat map of US hot springs (soakingsprings.com)
    38comments
  26. Stable (YC W20) Is Hiring Product Engineers (usestable.com)
    —discuss
  27. WaveDigger: Dig into wireless signals to discover their physical locations (github.com/christianrowlands)
    19comments
  28. Motor Characterization for Small Running Robots (2016) (robot-daycare.com)
    2comments
  29. Tutoring company tells parents to save their money and 'use AI instead' (afr.com)
    159comments
  30. Nokia Design Archive (2025) (aalto.fi)
    118comments

Ask HN: Is it worth it to learn C in 2020?

11 pointsby 6y ago
13 comments
6y agoHN ↗

What type of projects are you trying to build? Are you working on embedded technology or are you building web apps? The type of environment you work in will help decide. C is still a relevant and powerful language, but there are more modern alternatives in the same space like Rust.

6y agoHN ↗

Maybe if you want to write a kernel driver or a file system.

6y agoHN ↗

You can't go wrong with it. But for what purpose?

6y agoHN ↗

If you want to work, for example, in embedded systems it's a must

6y agoHN ↗

imho: always

especially if you are in to hardware, embedded, hpc, ... usecases.

6y agoHN ↗

The GNU/Linux kernel, FreeBSD kernel, Windows kernel, MacOS kernel, Python, Ruby, Perl, PHP, NodeJS, and NumPy are all written in C. If you want to review and contribute code, you'd need to learn C.

There are a number of coding guidelines e.g. for safety-critical systems where bounded running time and resource consumption are essential. These coding guidelines and standards are basically only available for C, C++, and Ada. https://github.com/stanislaw/awesome-safety-critical/blob/ma...

Even though modern languages have garbage-collection that runs whenever it feels like it, It's helpful to learn about memory management in C (or C++). You'll appreciate object destructor methods that free memory and sockets and file handles that much more. Reference cycles in object graphs are easier to handle with modern C++ than with C. Are there RAII (Resource Acquisition is Initialization) "smart pointers" that track reference counts in C?

Without OO namespacing, in C, function names are often prefixed with namespaces. How many ways could a struct be initialized? When can I free that memory?

When strace prints a syscall, what is that?

Is it necessary to learn C? Somebody needs to maintain and improve the C-based foundation for most of our OSs and very many of our fancy scripting languages. C can be very unforgiving: it's really easy to do it wrong, and there's a lot to keep in mind at once: the cognitive burden is higher with C (and then still with ASM and WebASM) than with an interpreted (or compiled) duck-typed 3GL scripting language with first-class functions.

What's a good progression that includes syntax, finding and reading the libc docs, Make/CMake/Autotools, secure recommended compiler flags for GCC (CPPFLAGS, CFLAGS, LDFLAGS) and LLVM Clang?

C: https://learnxinyminutes.com/docs/c/

C++: https://learnxinyminutes.com/docs/c++/

Links to the docs for Libc and other tools: https://westurner.github.io/tools/#libc

xeus-cling is a Jupyter kernel for C++ (and most of C) that works with nbgrader. https://github.com/QuantStack/xeus-cling

What's a better unit-testing library for C/C++ than gtest? https://github.com/google/googletest/

6y agoHN ↗

Amazing comment, thank you for your detailed input and the awesome resources. I want to get into C because I like network and system programming but lack the underlying knowledge and experience. These links will help me start on that new path. Very much appreciated sir :)

6y agoHN ↗

For network programming, you might consider asynchronous programming with coroutines. C++20 has them and they're already supported in LLVM. For C, there are a number of implementations of coroutines: https://en.wikipedia.org/wiki/Coroutine#Implementations_for_...

Once a second call stack has been obtained with one of the methods listed above, the setjmp and longjmp functions in the standard C library can then be used to implement the switches between coroutines. These functions save and restore, respectively, the stack pointer, program counter, callee-saved registers, and any other internal state as required by the ABI, such that returning to a coroutine after having yielded restores all the state that would be restored upon returning from a function call. Minimalist implementations, which do not piggyback off the setjmp and longjmp functions, may achieve the same result via a small block of inline assembly which swaps merely the stack pointer and program counter, and clobbers all other registers. This can be significantly faster, as setjmp and longjmp must conservatively store all registers which may be in use according to the ABI, whereas the clobber method allows the compiler to store (by spilling to the stack) only what it knows is actually in use.

CPython's asyncio implementation (originally codenamed 'tulip') is written in C and IMHO much easier to use than callbacks like Twisted and JS before Promises and the inclusion of tulip-like async/await keywords in ECMAscript. Uvloop - based on libuv, like Node - is apparently the fastest asyncio event loop. CPython Asyncio C module source: https://github.com/python/cpython/blob/master/Modules/_async... Asyncio docs: https://docs.python.org/3/library/asyncio.html

(When things like file or network I/O are I/O bound, the program can yield to allow other asynchronous coroutines ('async') to run on that core. With network programming, we're typically waiting for things to send or reply.)

Return-oriented-programming > Return-into-library technique is an interesting read regarding system programming :) https://en.wikipedia.org/wiki/Return-oriented_programming#Re...

6y agoHN ↗

Only matters if you want to work in embedded devices/IoT, operating systems, any other type of systems development or high-performance development, and some segments of game development or games middleware.

6y agoHN ↗

Yes. Many current hot languages are based on the C's structure plus there are millions of lines of C code that need maintenance. It's worth learning now and it will be worth learning 10 years from now.

6y agoHN ↗

I say yes because, as others have pointed out, C is at the base of nearly everything. If not C then you should learn some systems level language, be it C, D, rust or whatever. If you want to know how modern computing actually works then that's the way to do it.

You'll learn lessons that will teach you how to avoid common pitfall mistakes in higher level languages. And you'll be able to interop with C/C++ libraries which can be quite useful. And your code will run faster than most other languages can achieve. There are lots of reasons to learn C even today.

6y agoHN ↗

Most certainly. I do suggest C++ over C though, for a higher paying job.