It recently occurred to me that I (and I think most people) learned computer programming starting with something like Visual Basic. I began to wonder if we had started at the lower level first if it would be easier now.
Do you think it is any value as a programmer to understand things like how a CPU works, the basic instructions, and things like that? I mean after all aren't we really talking to it in the end?
If we started at the CPU level and taught from there up we might find that we can understand how to manipulate it at a high level easier.
The CPU performs calculations, makes logical comparisons and moves data up to billions of times per second. It works by executing simple instructions one at a time, triggered by a master timing signal that runs the whole computer.
If you are making games and these games are very graphically intense, then you might think of having a powerful GPU. Otherwise for compiling and Coding, a decent CPU is must.
The component of a computer system that controls the interpretation and execution of instructions. The CPU of a PC consists of a single microprocessor, while the CPU of a more powerful mainframe consists of multiple processing devices, and in some cases, hundreds of them.
The CPU is the brain of a computer, containing all the circuitry needed to process input, store data, and output results. The CPU is constantly following instructions of computer programs that tell it which data to process and how to process it. Without a CPU, we could not run programs on a computer.
It goes both ways.
For example, a lot of people that started at a higher level have no idea why shifts are so much faster than multiplication and division, or the impact of branching, etc.
As a result, they often write code that is slower, but easier for the average person to understand. (Note that for some applications, going faster is more important than being easy to understand)
Someone that has an understanding of what's going on behind the scenes (how many clock cycles different operations take, how a CPU's pipeline works, the impact of caching, etc) can often write code that is very fast, but can be difficult for many people to understand/maintain. (This is particularly difficult in applications where the "optimization" has no perceivable benefit, and maintainability is more important)
Personally I feel that knowing "what's going on below" at least gives me the ability to know the impact of the decisions I'm making.
Honestly, at this point, I don't mind leaving a lot of the low level details/optimizations up to the compiler. It probably does a better job than I would anyway :]
I've learned quite a bit about low-level programming, and I think it's been tremendously helpful in every bit of code I write. Even high-level languages have some version of, say, the basic synchronization primitives (mutexes/locks, conditions, semaphores); they still have to read from the disk or from a network card; they still have to copy bytes from one place in memory to another, and so on... the point is, the fact that you're using a high-level language doesn't mean it's useless to know how those things work. If you have an understanding of how a computer functions at the lowest level, you can always apply that knowledge to write more efficient and/or less bug-prone code regardless of how abstracted your platform is. Knowledge of the low-level operations can even teach you things that you might never have learned otherwise - there's no better way to learn how to properly use something like a mutex than to have to implement one. (Okay, maybe that's slightly exaggerated, but you get my point I hope)
Bottom line, I would say that yes, it is absolutely a good idea for programmers at all levels of abstraction to learn about the fundamentals. But I don't think it's necessarily such a good idea to start with the fundamentals. Programs at the level of assembly language are notoriously hard to understand and I think trying to foist that on a beginner to programming is just likely to discourage him/her. I mentioned that understanding basic operations will help you write more efficient and/or less error-prone code, but it's certainly not necessary to write code at all. So in my opinion, most people would probably do best starting somewhere in the middle, where they can still latch on to familiar concepts like objects while getting acquainted with the process of coding. After some experience in that area, CPU stuff is fair game ;-)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With