Did you ever have a program with bugs?
The building code is pretty cool. Not knowing anything at all about construction I was fascinated to see the detailed specifications about what must/must not be done in various kinds of residential and commercial construction. Like requiring thicker gypsum / sheetrock inside of closets located under stairwells. Why? Because if a fire breaks out in the closet, the staircase burns, and then egress is cut off for people on the upper floor.
Another interesting one is a requirement to have vertical bars on deck railings rather than horizontal ones. Why? Because it's harder for kids to climb over the railing and fall.
There are thousands of specifications like this. Some small details, some major structural points. How windows should be properly flashed, pipes connected, electricity kept safe, the foundation secured, on and on and on.
People have been living in houses for a very long time.
Houses rot, fall down, burn down. Pipes burst. Roofs leak.
Each of the rules in the building code have arisen because some particular failure scenario happened enough that it made sense to add the rule.
It kind of creeps me out. Behind that rule about thicker lining in stairwell closets are... well, some fires that burned out stairwells. And perhaps some people who couldn't get out. It's not just a theoretical.
According to Wikipedia, the Code of Hammurabi from ancient Babylon in 1760 B.C. was the first building code:
- If a builder builds a house for someone, and does not construct it properly, and the house which he built falls in and kills its owner, then that builder shall be put to death.
- If it kills the son of the owner, the son of that builder shall be put to death.
- If it kills a slave of the owner, then he shall pay, slave for slave, to the owner of the house.
- If it ruins goods, he shall make compensation for all that has been ruined, and inasmuch as he did not construct properly this house which he built and it fell, he shall re-erect the house from his own means.
- If a builder builds a house for someone, even though he has not yet completed it; if then the walls seem toppling, the builder must make the walls solid from his own means.
There is no building code for software. There are a lot of anecdotal proscriptions, and a ton of knowledge on the subject. But for joe the general software contractor - Jeff Atwood's "80%" programmer - sometimes the expedient is chosen over the correct. Not because they're malicious or incompetent. Just because they haven't devoted their life to studying the art. They just want to learn the trade and work it. Where's the rulebook?
In software, unless you're in medical devices, or fly-by-wire aircraft systems, you don't usually kill people with bad software. Thank goodness.
We haven't been living in software houses for thousands of years. They're each more complicated and each software system is novel. It's still a black art. And every software project is in part an R&D exercise.
So I think it's still a long time before we'll have a building code for software.