Ask HN: How do I learn C properly?
432 pointsI have 15+ years of experience in many languages: javascript, python, go, etc.
I can write C, but I'm not confident I'm doing it the right way. There are now decades of forums and blogs I can search through, but I'd love to have a single, clean, clear source of truth for recommendations on how to write C code.
I've started reading "Modern C" by Jens Gustedt. I'm not sure if this is the closest to a modern source of truth.
Note, I'd like my C code to work on Windows, which possibly restricts the "right way" to features provided by C89. But again, I'm not sure, the internet is super clear on this.
Thanks for the tips!
Comments (199) 63 threads
Earlier commentshttp://c-faq.com/
What did you want to do on Windows? I think this depends as much on the compiler as the code.
I'll also recommend C++ FQAs [1]. It's C++, yeah, but it's relevant to C in many places, and since a lot of systems programming now uses C++ as the lingua franca, it's a good, entertaining resource.
1: http://yosefk.com/c++fqa/
And practice pointers. Get really comfortable with how memory works.
For example, I’m trying to learn Linux drivers or embedded programming and I thought that I’d find in a C book information about registers and such, but registers don’t really belong to the C domain but to the hardware domain.
Thus, maybe find a way to clarify what you want to use C for and then learn those domain problems and how C solves them.
All comments shown.
Couldn't load more comments. Check your connection and try again.