2

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?

Phil Braun
  • 411
  • 2
  • 6
  • 10

2 Answers2

11

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)

Dan Pichelman
  • 13,853
6

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