There's "Learn C The Hard Way" -- http://c.learncodethehardway.org/book/ . It teaches you the essential, modern practice of developing with Valgrind right away.
I'd also suggest going though the exercises in "Computer Systems -- A Programmer's Perspective", which uses Linux, C and some assembler. http://csapp.cs.cmu.edu/ Good C programming is mostly about good computer science, because the C language is small but you operate close to the metal.
K&R remains a marvel of concision, but its blithe, unskeptical usage of the C standard library is outdated and problematic.
Re:NASM Examples
by cushychicken on Wednesday November 19, 2014 @01:15PM
(#8631610)
I think the best (or at least my favorite) thing about Learn C The Hard Way was an extra credit assignment of going through the K&R book and finding a way to break every piece of sample code. Talk about a learning exercise.
Assembly language is great and will teach you a lot of how the computer really works at a low level. Everyone should write their own asm optimized triangle drawing routine at least once. It's not something you need to learn every detail of - that's what references are for, but it's definitely good to have some understanding of. People talk about how you should learn functional languages like haskell as it will make you a better programmer, even if you don't use it. The same is true of assembly language.
If you do any significant programming in C or C++, you will be looking at assembly dumps at some point, even if only in a debugger.
However, in my current job, I range between CoffeeScript, Ruby, Java and C++, and the only time I've had to break out assembly was when optimizing a Java loop - I had to ensure the JIT was doing all the right things, like loop unrolling and bounds check hoisting.
I am no where near a low-level programming expert. But learning ASM in correspondence with the x86/x64 instruction set really helped me understanding how computing works. All this with just simple stuff, for instance incrementing a counter every second.
I would say that learning a bit of assembly is still relevant. I wouldn't waste too much time working on real projects but having that base knowledge provides a lot of insight into how it all compiles down.
I'm a CSE major about to graduate with about 18 months in the industry, mainly using JS/Java/Python. I've recently wanted to start getting into low level programming and wasn't sure where to start. I wanted to start with C and move up to C++ eventually, would it be worthwhile to start with ASM? Also does anyone know of any good resources for learning modern C? Is k&r still relevant?