Mixed feelings here:<p>* Knowing what the machine is doing is useful and important, especially while debugging. I think every really good C coder I know has been comfortable with assembly at least on some platform.<p>But…<p>* C is not a fancy macro assembler. C's behavior drives an abstract machine, and any machine code that achieves the same output assuming that all the C behavior is defined is equally valid. The believe that compiler is just transliterating your code to ASM is responsible for many serious bugs. C Compilers haven't been like that for 20 years (or more). E.g. aliasing rule violations. The fact that it isn't is utterly essential for performance, especially as things like good SIMD use become more critical for performance.<p>Even when the compiler is mostly transliterating the expectations from the simplified mental machine model can be misleading, e.g. alignment requirements on load on some architectures.
<p><pre><code> $ CFLAGS="-g -O0" make simple
cc -g -O0 simple.c -o simple
$
</code></pre>
This is so handy. I never knew that you could call make without writing a default Makefile. Thanks!
I sometimes think that an ideal approach to learn programming might be to learn it on several abstraction levels at once to see how things interact.<p>One good combination would be Assembly + C + Python for instance. Assembly helps understanding C and C helps with understanding Python.
I'm not sure how long this has been the case, but this is how C is taught at my school (Penn) and I'm sure many others.<p>In my CIS240 class (currently enrolled) we learn computers from the ground up and eventually learn C. First we do binary arithmetic by hand to get a feel for it, then we design basic circuits (and some complicated) that can perform the basic computer instructions (ADD. MULT, SHIFT, AND, XOR, etc.) then we keep building up off of these basics until we are finally writing C, at which point we will (hopefully) have a good grasp at what is going on and appreciate our programming language of choice a whole lot more.
Assembly was always daunting to me. Then I took Computer Systems at the University. It ended up being seriously fun. The way it made me think and try to solve problems were engaging and different it seemed. It required a new way of thinking and made me think about things I never thought about. Although we only wrote smaller programs for the class, I found them fun and I still remember the class nearly 10 years later.<p>In regards to the original post, I'm not sure I would be putting C with assembly or learn one over or for the other. They both have their uses and reasons for knowing. Forcing yourself to learn one before the other does not seem like a logical way to go. I think it's best to start with what makes the most sense for your end goal and / or you are most interested and motivated to begin and get most deeply into.
I used to teach Assembly and I spend a lot of time talking about how it connected with C since assembly is almost always used in conjunction with C. I have a free text on the web that was used in the class. It only covers 32-bit x86 since that's all there was back then. <a href="http://www.drpaulcarter.com/pcasm" rel="nofollow">http://www.drpaulcarter.com/pcasm</a>