News for hackers. Stuff that matters.
Re:Modern C, Second Edition by ScottFree on Wednesday September 18, 2019 @03:57PM (#21009396)
I just finished Learn C the Hard Way and would be interested in a comparison between it and those other books mentioned.

Just from a quick glance, Modern C appears to be a much more in depth book. It appears to cover things like memory alignment, advanced types like unions, malloc, threads, etc.

Learn C the Hard Way is more of a quick introduction. You learn the basics, like pointers, basic data structures, basic types and then learn to do something interesting with those basics (build a web server). It also teaches some valuable real life practices that Modern C doesn't touch on, like how to structure your project, makefiles, how to use Valgrind and gdb.

Re:Modern C, Second Edition by tom_mellior on Thursday September 19, 2019 @05:18AM (#21014585)
Wait what, Learn C the Hard Way doesn't teach malloc? Programming without dynamic memory allocation is pretty restrictive. What "data structures" does it even teach if it doesn't cover malloc?
Re:Modern C, Second Edition by ScottFree on Thursday September 19, 2019 @06:10AM (#21014850)
Like I said, it teaches the basics. There's a single page on heap vs stack allocation and it says malloc allocates memory to the heap. That's it. That's all you really need to know to do stuff and it doesn't go into what malloc actually does under the hood.

Modern C has an entire chapter called "malloc and friends" where it goes into much more depth about malloc, calloc, realloc, etc.

The book is a good introduction to programming in C and I'm glad I read it. You obviously have a history with the author and I'll thank you to keep your past impressions out of this particular discussion.

Re:Modern C, Second Edition by tom_mellior on Thursday September 19, 2019 @07:45AM (#21015288)
> There's a single page on heap vs stack allocation and it says malloc allocates memory to the heap. That's it. That's all you really need to know to do stuff

Every other C book seems to disagree, but OK.

Does the book cover the -> operator? Does it mention free and realloc? You need those to do stuff, at least.

> You obviously have a history with the author

How is this obvious, since it is incorrect?

Re:Modern C, Second Edition by ScottFree on Thursday September 19, 2019 @08:03AM (#21015369)
I'm not interested in continuing this line of conversation. Read the book if you want to know more.