News for hackers. Stuff that matters.
Re:Actually Portable Executables by jtvjan on Sunday February 28, 2021 @06:42AM (#26292664)
I really liked "The C Programming Language (second edition)" by Kernighan & Ritchie. It doesn't teach C99 and later features, but if you want to write portable code you're not using those anyway.
Re:Actually Portable Executables by e12e on Sunday February 28, 2021 @08:56AM (#26293434)
From various discussions on Hn, I think the consensus is most people really like k&r as a technical book (it's concise, clear and a fun read) - but everyone working with C says its a terrible book for learning modern C.

I tried to refresh my memory from previous threads, and I think the general trend has been to recommend (as seen in sibling comments):

https://modernc.gforge.inria.fr/

https://nostarch.com/Effective_C

I've also seen the older:

https://www.oreilly.com/library/view/21st-century-c/97814493...

Mentioned.

There's also Architecture of Open Source Applications, which can help with starting to read some larger code bases, some of which are in C: http://aosabook.org/en/index.html

And there's a general recommendation to go read the source code of the Redis cache/db.

Finally i came across a mention of this short article on gdb (nb: mention of TUI text ui should probably have been in the top, not a foot note):

https://www.recurse.com/blog/5-learning-c-with-gdb

I feel I'm missing a book that has come up often, but can't think of which one.

I did like zed Shaws learn c the hard way, but I'm afraid it's getting a bit long in the tooth: https://learncodethehardway.org/c/

Re:Actually Portable Executables by sillysaurusx on Sunday February 28, 2021 @08:22AM (#26293239)
K&R is a horrible way to learn C. It's the best way to make someone run in the other direction, though.

It's like telling someone that SICP is the best way to learn Scheme. Maybe, but lots of people learn differently.

Unfortunately I don't have good suggestions myself, but at least they won't feel bad if K&R isn't their cup of tea.