Monday, February 5, 2007

The Essential Hardness of Programming

Software engineering's preoccupation is the arrangement of bits, as opposed to atoms.  One of the properties of bit arrangements is that their marginal manufacturing cost is zero; once you have an arrangement of bits, you can make as many exact copies of that arrangement as necessary, whenever and wherever they're needed.  By contrast, an arrangement of atoms such as a bridge has a large marginal manufacturing cost, even if you just want an exact copy.  Further, there are few physical limits to bits, while there are sharp physical limits to atoms.  The only real limit to bit arrangement is the human brain, and economics (how badly people want bits arranged in particular ways). 

These are the fundamental reasons why nearly every software engineering project is attempting new design, and is thus hard.  This is because, in the world of software, design equals bit arrangements and copying a prior bit arrangement has zero cost.  Finding an appropriate bit arrangement used to have substantial cost, but that cost is falling towards zero too.  So for a given project, you can assume that competent software engineers have mostly found and copied the relevant patterns of bits where possible, and the remaining work is design

Think about what the statement above means.  This isn't like a civil engineer dealing with slightly differing terrain or traffic loads when adapting an existing design for a new bridge; it's more like a civil engineer being asked to build a bridge out of Jello on Pluto.  And the next time, to build atop a moving lava flow on Mercury.  In other words, with the easy, mechanical adaptations being taken care of by those ubiquitous bit patterns, the problems that are left for people to work out are the hard, surprising, novel ones.  Usually with nonlinear And in software, design really is everything; once you've taken design to a detailed enough level that the implementation is mechanical... we let the machines do it.

Which is why I winced when I read Scott Rosenberg's interview in Salon.  He gets it exactly right when he notes that there's always something new in every software project, otherwise there'd be no point in doing it.  But he goes off the rails when he says, "...programmers are programmers because they like to code -- given a choice between learning someone else's code and just sitting down and writing their own, they will always do the latter."  Jonathan Rentzsch has already skewered this statement better than I could.  It is of course true that there are some people who just aren't good at finding prior solutions, or at understanding them once found, and they may contribute to unnecessary re-creation of software, increasing both cost and risk to larger projects.  But they're not the norm, and aren't a major cause of the "always something new" phenomenon.  The essence of software development is new design.

This is also why attempts to map manufacturing based activities to software development are at best rough approximations and at worst dangerous distractions.  Software development is a knowledge acquisition activity, not a manufacturing activity.

2 comments:

Anonymous said...

I left a comment about your post on Joe Gregorio's blog, but I thought it was a little passive-aggressive to just leave a critique over there, so I've excerpted it here:

<blockquote><a href="http://bitworking.org/news/113/Knowledge-Acquisition#X3">I really like the idea of programming as knowledge acquisition. But the bit about "unnecessary re-creation of software" seems to contradict his whole piece and smacks of a little elitism if you ask me.</a></blockquote>

It's seems there might be some more nuance to "unnecessary" than you're letting on. As it stands, it seems in direct contradiction to the title of your post. What is unnecessary if done for the holy pursuit of knowledge acquisition?

Anonymous said...

I suppose whether a particular re-creation is necessary depends on whether you're an 'engineer' or a 'scientist'.  I was talking from the 'engineering' point of view, where the primary goal is to solve a problem.  Here knowledge acquisition is just a prerequisite and unnecessary re-creation doesn't advance your goal.  If you are being a 'scientist' and your primary goal is to acquire knowledge, then re-creation is fine and actually is a foundation of the scientific method.  Sometimes you have to go back and forth between the two roles of course.

Perhaps I misinterpreted Scott Rosenberg and he was really saying that the big problem is that programmers behave like scientists, when their projects need them to behave like engineers.  The root problem then is not competence but a conflict of interest.  I just don't think this is a key problem.  That is, it's a real issue, but I don't see it as the key reason why software projects take so long or fail so often.  I actually see the reverse problem a lot more (engineers trying to get a quick solution and not recognizing when it's time to step back and put on a scientist hat for a while).