top | item 24372591

(no title)

esamatti | 5 years ago

Since learning Rust I wanted to learn some C to be better able to consume pure C libs or embed Rust into C apps.

Along Modern C I found these modern(ish) C books:

- C Programming: A Modern Approach, 2nd Edition by King

- 21st Century C by Ben Kelemens

- Learn C the Hard Way by Zed Shaw

Can anyone recommend some of these for my background?

Besides Rust I've mostly used Webdev languages JS (mostly TypeScript these days), Python, Ruby, PHP, some Java back in the day.

discuss

order

liendolucas|5 years ago

Expert C Programming (Deep C Secrets) by Peter Van Der Linden is a fantastic book.

macintux|5 years ago

Seconded. Easily my favorite programming book for any language.

GeertVL|5 years ago

The best book for me was the King book. Clear. Thorough. And most importantly the order of the chapter topics. And definitely do the projects to practice.

wsc981|5 years ago

I haven’t read any other books from that list but the King book, but I found it very well written and easy to understand as well.

dasb|5 years ago

King's book is really good.

Areading314|5 years ago

The best C book is the Kernighan + Ritchie book "The C programming language", hands down. This is also one of the best books on practical computer science available today. Other books could help to provide a more modern take on how to adapt the language to 2020, but the original K+R book is still the best way to really learn the language.

_l4jh|5 years ago

I've been programming in C for twenty years now and K&R has a special place in my heart however I do not think it is the best book for a beginner to learn C.

If you're coming from COBOL and wanting to learn C (like the target audience at the time the book was written) ok perhaps it is a good book for you. But if you're coming from something like Python or Java or JavaScript (or even no language at all) there are better options such as K N King's A Modern Approach.

K&R is a fantastic book in its own right and I certainly think once you feel more comfortable with C it is a superb book to read and more importantly complete as many of the exercises as you can.

It is that I have seen too many people come from higher level languages or with no programming knowledge and find K&R frustrating due to its assumption the reader is already a programmer in some other (1970s) language with a fundamental understanding of some programming concepts.

pjmlp|5 years ago

Only for historical reasons, it is full of examples of bad practices regarding safe C code by modern standards.

nine_k|5 years ago

Do people still use the K&R style of declarations?

OTOH a microcontroller is an acceptable approximation of a PDP-11, so much of the old approaches are very directly applicable.