I'm a self-taught programmer, just in case this question is answered in CS 101. I've learned and used lots of languages, mostly for my own personal use, but occasionally for professional stuff.It seems that I'm always running into the same wall when I run into trouble programming. For example, I just asked a question on another forum about how to handle a pointer-to-array that was returned by a function. Initially I'm thinking that I simply don't know the proper technique that the designers of C++ set up to handle the situation. But from the answers and discussions that follow I see that I don't really get what happens when something is 'returned'.How deep a level of understanding of the programming process must a good programmer achieve?
Is it necessary to understand what's happening at the hardware level to be a good programmer?
self improvement;hardware
No. Nobody understands what's going on at the hardware level.Computer systems are like onions -- there are many layers, and each one depends on the layer underneath it for support. If you're the guy working on one of the outer layers, you shouldn't care too much what happens in the middle of the onion. And that's a good thing, because the middle of the onion is always changing. As long as the layer or layers that support your particular layer continue to look the same and support your layer, you're good.But then again...Yes. I mean, you don't need to understand what's really happening inside the onion, but it helps a lot to have a mental model of what the inside of a typical onion looks like. Maybe not the deepest part, where you've got gates made up of transistors and such, or the next layer or two, where you've got microcode, a clock, instruction decoding units etc. The next layers, though, are where you've got registers, the stack, and the heap. These are the deepest layers where you have a lot of influence over what happens -- the compiler translates your code into instructions that run at this level, and if you want you can usually step through these instructions and find out what's really happening.Most experienced programmers have a slightly fairy-tale version of these layers in their head. They help you understand what the compiler is talking about when it tells you that there was an invalid address exception or a stack overflow error or something like that.If you're interested, read a book on computer architecture. It doesn't even need to be a particularly new book -- digital computers have been working in approximately the same way for a long time. The more you learn about the inside of the onion, the more astounded you'll be that any of this stuff works at all! Learning (approximately) what's going on in the lower layers makes programming both less mysterious and, somehow, more magical. And really, more fun.Another thing you might look into is embedded onions. Er, I mean embedded systems. There are a number of embedded platforms that are pretty easy to use: Arduino and BASIC Stamp are two examples. These are basically small microprocessors with a lot of built-in features. You can think of them as onions with fewer layers than your typical desktop PC, so it's possible to get a pretty thorough understanding of just what's going on in the whole system, from the hardware on up to the software.