Should all decent programmers be expected to know at least something about low-level stuff such as the following:
- The gist of how garbage collection is implemented, how memory management works without GC, and exactly what the difference is between the heap, the stack and the static data segment?
- At least be able to read assembly language and have some idea what's going on (I'm not talking about a high level of proficiency here, just familiarity.)
- Understand some basic computer architecture concepts such as caching, out-of-order execution, pipelining, etc.
- Understand pointer semantics well and be able to write at least small, toy programs in straight C.
My arguments as to why these are essential skills for any decent programmer are as follows:
- All abstractions are leaky. If you don't understand at all how the layer beneath you works, you'll usually get burned sooner or later.
- IMHO, caring about performance breaks all abstraction/encapsulation. You may be able to get away with not caring how something is implemented if you just want the layer on top of it to be correct, but the minute you need it to be fast, you need to care about the implementation.
- Understanding how stuff works at a low level can provide a level of intuition about what is and isn't feasible, therefore making problems at a higher level easier to reason about. For example, if garbage collection is just magic to you, you may have no clue why all that data you've kept references to, but never access again causes memory leaks. However, if you understand that garbage collection works by tracing, not by semantic code analysis, it becomes immediately obvious why keeping references to stuff you don't need would cause memory leaks.
Do you believe that learning low-level stuff is important to all programmers? If so, what and why?