Should Programmers learn assembly?

10 points by csprestoninc ↗ HN
I think having a fundamental understanding of programming is helpful, but learning assembly is overkill (and offers limited benefit). Current popular languages are far removed from assembly.

It would be better to focus on learning current languages, programming patterns, concepts and styles.

Brett Miller http://www.customsoftwarebypreston.com

10 comments

[ 4.7 ms ] story [ 29.0 ms ] thread
A professional programmer needs to understand how computers work, including computer architecture. It's especially helpful for performance tuning.

BTW, your post looks like spam; we don't use signatures here.

Learning assembly isn't really about learning assembly. It teaches the underlying concepts for how modern languages. For instance:

The stack. Many languages use a stack to allow recursion/nested functions. To make this easier, many processors support instructions for pushing/popping operations on the stack, and will reserve a register for holding a pointer to the top of the stack. While learning assembly, the concepts of recursion and tail-recursion begin to make sense. You also learn about reentrance.

I may be opening myself up to attack, but I find that the best programmers around are the ones who started at the lowest levels and then progressed up the abstraction levels. It's quite easy to move up in levels of abstraction, but not the other way around.
I'm going to join you or at least offer a personal example.

The best programmer I have ever met programmed medical equipment in assembly when he graduated undergrad. I met him in graduate school and he was scary good regardless of the language.

You're making a false dichotomy.
I'm currently learning 370 assembler ;)
Is it an advantage to learn assembly?

Definitely. Necessary? Not really. Like others have said, learning assembly is more about understanding the underlying architecture, rather than learning assembly. However, its not a necessity to all.

It truly depends on what you want to work with. For example, if you wish to be a system developer that creates optimized web servers, compilers, middleware etc. then yes, learning assembly should be a top priority. Not necessarily because you want to put assembly in your code, but because learning about the architecture will greatly help you in optimizing your code in cases like these were optimized code is key to keep competitive. However, if you are a web developer, maybe learning assembly shouldn't be a top priority. Its not that you wouldn't benefit from it, because you certainly would. But learning other topics like scalability and authentication would be more profitable to learn.

Like with anything, it truly depends on how you would use your knowledge on what knowledge is most important to you.

> It would be better to focus on learning current languages, programming patterns, concepts and styles.

Better for what?

And, after we've decided how we're defining merit, some evidence would be nice. At some point we get to talk about how we're measuring said merit.

You did want us to take your statement seriously, right?

Every serious programmer should learn assembly language (and the underlying machine language too) for a variety of different machines and architectures. There are times when it is the appropriate vehicle for expressing a program. Programming languages and their compilers, optimizing or not, generally do not allow easy, efficient access to all of the capabilities available in the machine; assembly language does.
(comment deleted)