views:

214

answers:

5

It struck me the other day that I know nearly nothing about the hardware I expect my software to run on. I've been a dev for around 5 years but I haven't looked into hardware theory/design since i left University. I don't even build my own machines anymore because, being brutally honest, I'd rather pay the extra few bucks and let the Comp Sci drop-out build it at the shop for me.

Whilst it's clearly important to have a good understanding of the basics of what's going on under the hood, it's abstracted so far away from us as devs we really don't need to concern ourselves with the intricacies of Programmed I/O or Memory-Mapped I/O etc,..

Or do we?

Note that I'm talking about your every-day LOB dev here and not the dedicated bare-metal guys.

So, define 'average' how you will but overall, how deep should a competent programmer be able to dive?

+8  A: 

It depends on how high-level your development is.

  1. If you develop for embedded systems, this means a lot of hardware knowledge (close to a EE level).
  2. If you are in some specialized area, like low-level 3D graphics programming for games, you should know ins and outs of specific graphics cards.
  3. If you are doing web or desktop applications, probably not so much.

But in all development, you probably should know the fundamentals. E.g.,

  1. Where are the bottlenecks in von-Neumann architecture.
  2. How does CPU cache works (important in multi-threading).
  3. How OS scheduling will be different on single-processor multi-processor CPUs (again, important in multi-threading).
  4. The way IO works and why when you write to a file does not necessarily mean you data is immediately persistent.
  5. How slow is IO and why most database applications are IO-bound.
  6. Why network is even slower and less reliable than IO (and wireless network even more so).

On the other hand, I don't think knowing the specifics like what memory-mapped IO is, or knowing the difference between NAND and NOR flash is really important for an average* (desktop/web) developer. Even the knowledge of the architecture of a modern CPU is probably going to be a science in itself seeing how complex they've got in the past years, not to mention that the code emitted by modern compilers is becoming more difficult to predict (the article linked shows that it's harder now to outsmart the compiler at low-level optimizations). It's similar to being a car mechanic was easier a few decades ago, today not that many people will try to fix their cars by themselves.

*Definition of "average" may vary.

Alex B
+1. I would also like to *stress* knowledge of memory speed differences, at all levels. L1 cache, L2 cache, RAM, drive cache, and harddrive speed. Also how a rotating disk may be really fast sequentially, but how a flash disk can be fast at seeking.
Amigable Clark Kant
That's a comprehensive enough answer for me. cheers dude.
Stimul8d
+3  A: 

It's certainly possible to get by without knowing anything about the underlying hardware. However knowing even a little bit about for instance how caches work and which operations are fast/slow on your particular target machine will help you make much better design decisions when designing the software.

On a personal note I think there's great satisfaction in knowing how the machine I spend at least 10 hours a day at work ;)

And then again why settle for average?

Andreas Brinck
+3  A: 

I find it extremely useful to be able to understand the assembly language emitted by the compiler, C++ in my case. This is very helpful when considering issues like optimisation, and resolving difficult debugging problems.

anon
+2  A: 

In many cases, you don't know which hardware your program will run on, so caring too much about some specific details of one machine makes no sense. Users might run your Win32 executable in a virtual machine on some 64Bit RISC hardware, who knows. Unless you definitely know the target hardware, it's better to use the abstractions that the OS and the standard libs give you, and use them as intended. Trust the people who build the OS, the compiler, the libs to do their job properly.

ammoQ
+1  A: 

OS developers make a great job in order to abstract the underlying physical world. Their purpose is to provide the average developer with a common interface to many hardwares so he can focus on its application and develop code that is portable, easier to maintain and able to gain optimizations on OS updates.

So for an average developer making an average application, I think it is better not to ask too many questions about hardware.

mouviciel
First time I've ever seen it suggested that lack of technical knowledge is a good thing.
anon
My argument is not intended to prevent people from learning! It is about specialization, delegation and focus as means of effectiveness.
mouviciel
@Neil, they say ignorance is bliss...
Benjol