4 ms·
Would anyone have an up-to-date book recommendation for someone looking to learn C? Is K&R still the best way, or are much more recent things like Modern C [1]
by olivierestsage 6y ago
Would anyone have an up-to-date book recommendation for someone looking to learn C? Is K&R still the best way, or are much more recent things like Modern C [1] the way to go? I am concerned that if I learn techniques that are too "modern," I might not be able to contribute to open source projects that employ older conventions.
[1] https://modernc.gforge.inria.fr/ https://modernc.gforge.inria.fr/
- rightbyte 6y agoJust go with K&R of the latest edition. It gets you into the mood. Concerning modern techniques I don't really understand what that would be.
- shrimp_emoji 6y agoModern C: "use Rust instead".
- ghostwriter 6y agoModern C: don't use Rust, use regular C and incrementally wrap & migrate it to ATS[1][2] [1] http://ats-lang.sourceforge.net/DOCUMENT/INT2PROGINATS/HTML/INT2PROGINATS-BOOK-onechunk.html http://ats-lang.sourceforge.net/DOCUMENT/INT2PROGINATS/HTML/... [2] http://ats-lang.sourceforge.net/DOCUMENT/INT2PROGINATS/HTML/INT2PROGINATS-BOOK-onechunk.html#Cinteraction http://ats-lang.sourceforge.net/DOCUMENT/INT2PROGINATS/HTML/...
- flohofwoe 6y agoThe latest K&R edition is from 1988, C has changed quite a lot since then... especially with C99 which almost feels like a new and much friendlier language because of the new initialization features (compound literals and designated init).
- Ericson2314 6y agoLearn Rust first, then go read someone's C codebase. Maybe consult https://en.wikibooks.org/wiki/C_Programming https://en.wikibooks.org/wiki/C_Programming for any syntax you don't recognize.
- zokier 6y agohttps://nostarch.com/Effective_C https://nostarch.com/Effective_C This seems promising, would be nice to hear what HN thinks of it
- thojest 6y agoI just read it and like it very much, especially for its brevity and because it is on-point. If you have experience with low level languages, pointers, memory and actually have some programming experience, then this is your book, especially because it is so up-to-date. But I would not recommend it to someone, who has no experience and wants to learn C as a first language.
- whydoyoucare 6y agoI still consider K&R to be "the" book to learn and appreciate C. Over two decades, I have seen/read several books, but keep coming back to K&R. It isn't just about the language that makes K&R great -- along with the ride also comes valuable (programming) life lessons, experience with terse language (minimum words to express maximum thought), and a lot of historical perspective that most modern books omit. I would also recommend using the Steve Summit's "C Programming Notes" as you work your way through K&R. Pay attention to the "deep sentences". https://www.eskimo.com/~scs/cclass/krnotes/top.html https://www.eskimo.com/~scs/cclass/krnotes/top.html And don't skip the exercises at the end of each chapter. The discover of solving the exercises on your own is a revelation that far surpasses any benefit obtained by being told how to do it! :-)