6 ms·
Besides the classic C book by K&R, what are some more modern C books that the HN community vouch for?
by lprd 4y ago
Besides the classic C book by K&R, what are some more modern C books that the HN community vouch for?
- gre 4y agoMy favorite C programming book was Expert C Programming by Peter van der Linden, mainly for the method of reading any C declaration and for teaching me the difference between libc calls vs syscalls. There's also a book called Modern C by Jens Gustedt from 2020 that I have and is more beginner friendly. The way I learned C is I printed out the Beej's guide client/server code and walked around staring at it until it made sense. (That and compiling/running it and looking up functions in the man pages.)
- macintux 4y agoExpert C Programming is brilliantly written. I recently bought another copy because I lost mine; I don’t actually need it, but it’s a fun read regardless.
- beej71 4y agoI did write a guide to C that's currently in beta. If it's any good or not... Well, I'll leave that up to you. :) I also really like K&R2 and Van der Linden. https://beej.us/guide/bgc/ https://beej.us/guide/bgc/
- lprd 4y agoI'll most definitely be checking out your guide! Thank you so much for your contributions in the community :) Will the latest revision of your Networking Guide be available on print any time soon? I'd love to buy a copy.
- shric 4y agoI think C Programming: A Modern Approach by K.N. King is great.
- jamal-kumar 4y agoHas anyone actually even tried the K&R book in the past couple of decades and not run into issues like the assumption of unbuffered shell output? You get like one or two chapters in and things are already behaving outside of how they did when that book was written in the 1980s. It's a classic, yes, but I don't recommend it to anyone outside of people writing code in C89 for vintage systems... Yet the amount of suggestions I see from people who haven't actually learned C from scratch since the 1990s to read that particular title is high enough that I can't do anything but scratch my head over it. Tons has changed over thirty plus years. If you're looking for something up to date I'd recommend this: https://gustedt.gitlabpages.inria.fr/modern-c/ https://gustedt.gitlabpages.inria.fr/modern-c/
- emmelaich 4y agoK&R2 is hard to beat for size and clarity of writing. Could you elaborate on the "unbuffered shell output" comment?
- icedchai 4y agoI'm guessing he's talking about the putchar/getchar example in the first or second chapter?
- jamal-kumar 4y agoYeah that. It's extremely confusing and where a ton of people stop reading it.
- icedchai 4y agoI taught myself C from K&R 2, and a platform-specific (Amiga!) book, back when I was a teenager. In three decades, not much has really changed with the core language.
- jamal-kumar 4y agoWhile the core language has stayed the same the tooling and development environment has changed quite a lot. Proper modern compiler flags (-Wall etc) for example would be a huge help to new learners and for best practices, but k&r isn't mentioning these. I still think it's a good book but if you throw it at someone new to this they're going to be wondering why what they are writing isn't behaving as expected.