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.

It is clear that the knowledge of low level stuff is very important in our work.

But in a situation where you're already developing commercial software on a high level, and when you already have a chosen direction but don't have any assembly skill, isn't it more reasonable to focus on studying stuff related to your direction? Or is there a reason you should spend some time to learn the low-level basics anyway?

When is it too late, and when it is not? And if it is not too late, then how would one go about learning optimally (in the sense of not spending excessive time to get some depth and understanding)?

share|improve this question

closed as primarily opinion-based by MichaelT, GlenH7, Bart van Ingen Schenau, Kilian Foth, Dynamic Apr 18 at 17:19

Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise.If this question can be reworded to fit the rules in the help center, please edit the question.

    
Lots of questions in one post :) –  Shamim Hafiz Dec 17 '10 at 14:50
    
I enjoyed Assembly Language Step by Step. Lots of programming noobie-ish stuff at first, but the author is very entertaining. I've found having a general idea is helpful and I primarily write JavaScript. –  Erik Reppen May 17 '12 at 13:57
    
My first (taught) language was an assembly dialect. I can see how it would be useful (in the plethora of ways that others have pointed out), and it helps you to provide different input for the rest of the team. –  Jamie Taylor May 17 '12 at 15:40

11 Answers 11

up vote 36 down vote accepted

Can't believe no one has mentioned debugging...

I haven't written a line of assembly code in many years now. But I read it reasonably often. High-level debugging is great when you have the source and symbol information, but when your fancy library is throwing an unhandled exception on customer machines, it's too late to require that to be included in the license...

But I can still open up the disassembler and see what your high-level logic eventually ended up doing, trace bad data back to its origin, find out who changed the FPU control register...

This has saved my bacon more often than I care to think about. And it's never too late to learn - there are plenty of great references and tutorials out on the 'Net, and just about any program running on your machine can provide a hands-on environment.

share|improve this answer
9  
+1, and I'd upvote it more if I could. Every serious developer needs to be able to read ASM for this if no other reason. –  Mason Wheeler Dec 17 '10 at 15:54
2  
The corollary to this is optimization. Knowing how the complier translates your code into assembly can help you to make it dramatically faster! –  lambacck Dec 17 '10 at 17:54
2  
+1 Assembly is one of the only languages that force you to understand how a processor actually works. It helps you in your development with high level language. Must read: blogs.msdn.com/b/ericlippert/archive/2010/09/30/… –  user2567 Dec 17 '10 at 19:52
    
Knowing the underlying computer is INSANELY helpful, whether for debugging, optimization, or sheer curiosity. Seriously, learn to read at least one or two families of assembly language. Even if you never read it or write it after learning it, it will affect the way that you understand things in the future. Now, if you would rather write in no other language, that might be a bit much... –  Michael Trausch Dec 17 '10 at 23:26
1  
@Mason: I don't know if "every serious developer" needs to be able to read ASM. If you are writing JavaScript or using a programming language built atop a thick framework (like .NET or Java), I wouldn't regard being able to read ASM as essential to being a serious developer. That being said, having an understanding of how the computer executes instructions on a very low level can be quite helpful, even in higher order programming languages and environments. –  Scott Mitchell Dec 18 '10 at 0:01

If you truly have no low-level programming skills, I would highly recommend learning some in your spare time. You don't need to become an expert at it; just reach some level of proficiency. You have to do a lot of the math work yourself, rather than depending on the compiler or libraries to do it for you. It will help you understand readability in programming, since most assembly instructions correspond to one processor instruction. You have to manage the complexity in slightly larger programs yourself, without the benefit of things like if...else. This will help you write simpler high-level programs, because the assembly experience would have taught you how much easier it is to read.

Also, remeber that assembly is not a language! It is a generic term, that basically means the instruction set of a processor that has been abstracted to a symbolic language. Different processors have different instruction sets, and therefore different assembly languages. When you learn 'assembly', you learn a process, not a language.

share|improve this answer
2  
+1 for assembly is not a language; it's a process. –  gablin Dec 17 '10 at 22:15

Isn't it more reasonable to focus on studying stuff related to your direction? Or is there a reason you should spend some time to learn the low-level basics anyway?

Answer:

  1. If you are not planning to change your direction to program embedded system there is no reason to learn assamble. Even thought that assembly is CPU depended you may learn some basics but your knowledge will be based on CPU architecture and instruction set for that CPU.
  2. Let say you code for Windows. If want to learn lower level than high level language that may benefit you current direction, I would recommend you to learn Windows I deep, Windows API, Windows memory management etc. Simply learn the OS/Platform you are coding.
  3. Improve your skills on your current high level language, such as memory management, garbage collection etc. If you want to go low level.
share|improve this answer

It had been very important in my prior life as a supercompuer guru. Back then I felt you didn't understand a machine until you had written at least several hundred lines of assembler, and tinkered with it trying to squeeze out performance. As very few programmers wanted to go that deep, it made me really indispensable. And I still have a common language when talking with HW designer types.

But, really the need/benefit for this is mostly a couple of decades past. Between compiler advances, and advanced out of order execution HW there is very little scope for being able to play the hero by writing assembler any more. Although I think it useful to understanding how things work. I plan on teaching my kids (freshmen CS majors) to program in a very simplified assembler on a simple virtual machine, just so they have a feel for what goes on. Hopefully we can play with stuff like unrolling, software pipelining, caches, and prefetching, bottom loading etc. So at least they will know that at some level this stuff is going on.

share|improve this answer

In the Teaching profession, at least here in the UK, teachers have to be qualified far in excess of what they teach. A Secondary (High School) teacher would be expected to have a degree in the subject they taught, and Primary (Elementary) school teachers have degrees too, and have to be proficient in all major subjects up to a good grade GCSE level (high school exit exams?, no real US wide equivalent).

Why? Because in order to teach something well, or indeed use something well, you have to understand it. This requires understanding the underlying structure, the chain of decisions before the one you are working with that led to it. In order to properly understand high level code, you must understand the layer upon which it is built, how it operates, where its strengths and weaknesses lie. This is recursive, to understand the layer beneath, you must understand the layer beneath that as well.

In the end, this is why the decent university/college courses in Computing ask for good maths ability before everything else, as that is effectively the bottom rung.

Maths -> Physics                ->
      -> Chemistry -> Materials -> Hardware Design -> Microcode      -> Assembler
                                                   -> Bus Interfaces -> Peripherals

... Assembler    -> Low Level      -> High Level   ->
... OS / Drivers -> API Level      -> Applications -> User

If you lack knowledge in these areas, then your understanding is compromised beneath it. The closer to the level you operate another layer is, the more important it is to have a grounding in it.

So: Do you need to know assembler as a high-level coder?  It will help.

share|improve this answer

I don't know how much use studying assembly would be. But at the very least doing some programming in a language like C would be beneficial. I have recently had to do some programming in C and I have found it to be rather enlightening. C removes much of the abstraction that is present in higher level languages. Those abstractions do not come without a cost. You have to manage more of the lower level details in C, where as in a higher level language those details are being managed for you. By doing some programming in C you will have to become aware of those details. So when you are back in your everyday language, you will still have that awareness and will better appreciate what is actually happening. That should help to make you a better programmer.

share|improve this answer

You should know what it is and what the computer is doing. Learning something like Knuth's MIX will help you. Mostly being able to judge the efficiency of your code. Go get the Art of Computer Programming and read it. It will make you a smarter programmer.

share|improve this answer

Yes - Continuous, life-long learning is an essential component of a career in Software development. If you are interested in continuing to learn about programming and how to improve your craft then yes, at some point you should learn assembly as it will expose you to a completely new language and way of writing code. For the same reason, I recommend experimenting with many languages / programming styles including Ruby/Python (dynamic language), Haskell/F# (pure functional language), Lisp/Scheme (functional language), etc...

I would say that it is too late if you are no longer interested in learning more about the programming craft. For example, if you have reached the point in your career where you may soon be moving on from programming into another area such as Management, Systems Engineering, Sales/Marketing, etc. If you think you might want to move into a new area in the next few years then I would focus more on the skills necessary to develop in that area, instead of on the programming craft.

share|improve this answer

I think you reach a point of diminishing returns as your career advances. That is, you should learn assembly language early, as it leads to a better fundamental understanding of everything that comes after. However, if you're already in the work force and have a few years of experience, you'll already have a feel for the way things work, so learning the actual nuts-and-bolts details may not provide you with as much insight.

share|improve this answer

You will always benefit from peaking under the covers and understanding a bit more about the what sits beneath the abstraction you are standing on top of. As a college professor of mine stated once "All good programmers understand the hardware" -- you don't have to be able to create and manipulate circuits, but you should have some grasp of whats going on down there -- it will only make you better.

Try Computer Organization and Design

share|improve this answer

You don't need to learn assembly language, you just need to understand how it works. You need to know what XOR is and count in binary in your sleep, etc. But I have never needed assembly code in my work, ever.

So as you say, knowledge of low level stuff is important, but practical knowledge in assembly is not.

share|improve this answer
1  
I second. You can earn a good living programming and never have to read/write ASM. There are some positions that require it. Reading a dump after a race condition in your code took down the process. Or if you write very perf-intensive programs (like GPU parallelization/OpenCL). The percentage of dev jobs where you will be required to perform these tasks are very small. –  yzorg Dec 18 '10 at 7:13
    
+1 for "knowledge of low level stuff is important". Also @yzorg: for me, that link doesn't work –  Jamie Taylor May 17 '12 at 15:42
    
One more caveat, if you can't understand this blog post and you're writing code that uses thread/parallel/task/future then you're not done. Keep learning what Joe Duffy is talking about until you understand it. bluebytesoftware.com/blog/2010/12/04/SayonaraVolatile.aspx –  yzorg May 25 '12 at 16:56
    
Which has absolutely nothing to do with this question. –  Lennart Regebro May 26 '12 at 4:40

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