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 commentsDepending on how deep you want to go. The most in depth way to understand C is to learn assembly on an ISA first.
It’s one of the best books in the world. About anything. Ever.
That might be the case if you plan to use the Microsoft C compiler as they have publicly said the don't have plans to update their C compiler.
However that is not your only option, since clang and several GCC ports will also work on Windows.
MSVC is probably pretty close to C99 these days. Designated initializers are C99, for example.
As far as I know, MSVC just implements the C subset of C++.
Continue this thread — 1 reply
Continue this thread — 1 reply
afaik,
has never worked in c++.Continue this thread — 1 reply
Still pretty incomplete last I checked but portability is better than it was.
Continue this thread — 2 replies
I'm writing a book on C. I don't think it will ever be finished or see publication. I recommend writing a book yourself - it's a great way to learn, and maybe you're a better writer than me and will publish it.
All comments shown.
Couldn't load more comments. Check your connection and try again.