Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

This question already has an answer here:

I mostly work in Python and Ruby, but I recently decided to learn some C so I have a better feel for how a computer actually works.

I've been wondering whether it is possible to take this even a step further. Does anyone learn machine code (whatever C is compiled into) anymore? Would I benefit from taking some time to learn it?

share|improve this question

marked as duplicate by Robert Harvey, GrandmasterB, FrustratedWithFormsDesigner, MichaelT, gnat Apr 16 '13 at 21:00

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

4  
Is there ever not a benefit from learning something? –  GrandmasterB Apr 16 '13 at 20:24
3  
@GrandmasterB - yes the time you spent when you could have been learning something else. Would you have been better learning eg. a functional language than the details of compromises made by x86 20years ago –  Martin Beckett Apr 16 '13 at 20:34
    
The content of this question has been rephrased over and over again in other questions.. it never ends well –  hanzolo Apr 16 '13 at 20:40
1  
@MartinBeckett The question is whether there is a benefit, not whether the benefit is less than learning something else instead. –  The Muffin Man Apr 16 '13 at 22:19

2 Answers 2

up vote 6 down vote accepted

I learned it, but that was back in the days when Real Programmers Wore Mountain Boots.

Learning assembly will give you a wonderful appreciation for memory management, pointers, buffer overflows, caffeine, and the value of extreme patience.

My personal opinion is that it's worth writing a small test program or two, but not much more than that.

It takes a tremendous amount of effort to code features that are almost trivial to do in modern environments. (e.g., text to speech)

share|improve this answer
3  
"Real Programmers Wore Mountain boots." was a great read –  hanzolo Apr 16 '13 at 20:47
    
Real programmers still say things like if (i % 2 == 0) –  Robert Harvey Apr 16 '13 at 21:01
1  
Of course if you want to someday get a job writing compilers for a living, you might find it a lot more useful to learn assembly language for a couple of different CPU's than you would if you plan to work on a lot of line-of-business apps, but really have no plans to become a compiler programmer. Just saying... ;) –  Craig Apr 18 '13 at 4:43
1  
My favorite: Real Programmers don't write in FORTRAN. FORTRAN is for pipe stress freaks and crystallography weenies. –  Robert Harvey Dec 28 '13 at 3:25

Probably not.

There is an argument that knowing machine code will help you understand what the machine is doing in more detail. But so would knowing how the transistors work and nobody suggests you need to know semiconductor physics to be a good programmer!

Having some idea what the code is doing and what operations, such as copying memory or accessing a disk, are expensive is useful - but you can know these without being fluent in assembler. There was also an argument that assembler helps you debug a stack dump - but modern compilers can produce some very odd optomised code which is almost impossible to understand/.

If you want to understand assembler for the pure joy of it - then there are a number of synthetic assemblers, or at least more modern CPU designs which are cleaner than x86

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.