The Clean Code Blog

by Robert C. Martin (Uncle Bob)

After the Disaster

18 April 2012

There’s a disaster coming. I don’t know when. I don’t know what. But it’s coming, and there’s nothing we can do to stop it; but there is something we can do to mitigate it.

How much software is running near you at the moment? Of course you are reading this on a web browser, and that computer you are sitting next to has lots of software running in it. And there are probably many other computers near you with software running on them. Is there software in your cell phone? Of course. How about in your watch? Likely. In the light switch on the wall? How about in the light bulbs? The intercom? The doorbell? The thermostat? Your furnace? Your air conditioner? Your refrigerator, dishwasher, washing-machine, drier? How about your car; and all the other cars on the road? How about the traffic signals? Did you ride an elevator today? Get in a plane or a train? How about an escalator? Do you have a pacemaker? An insulin pump?

When you think about it, it’s everywhere And it’s spreading…

How many times per day do you put your life in the hands of an ‘if’ statement written by some twenty-two year old at three in the morning, while strung out on vodka and redbull?

Some time in the not too distant future, there’s going to be an event. Thousands of people will die. And it will be the fault of some errant piece of code written by some poor schmuck under hellish pressure facing impossible deadlines. Perhaps it will be an airline crash, or a cruise ship sinking. Perhaps it’ll be an explosion at a factory, or a train accident involving toxins. Perhaps it’ll be a simple clerical error at a medical research lab that causes a vial of smallpox or ebola to be improperly disposed of.

It doesn’t matter what it is. What is sure is that it’ll come. The probability is not high that it will happen today, or even this year; but the probability is also not zero. It will happen.

And when it happens, when thousands of people are killed by a stupid software error, the governments of the world will act. They’ll have to. The population will scream for protection, and the lawmakers will respond with self-righteous indignation. In their toolkit they’ll have regulations, restrictions, licensing requirements, and certification tests. They might take control of our education. They might specify who can be hired and who can’t.

What tools they bring to bear upon us depends upon us. When the disaster happens, what will the congressional and world court investigations find? Will they find a software industry that has defined a set of professional disciplines that it requires of it’s members? Will they find that the software industry has done the due diligence to ensure that it’s members are educated, trained, and skilled? Will they find that the software industry is composed of serious professionals who reliably follow their disciplines and practices?

Or will they find the chaos that exists today? Will they find developers who don’t write tests? (Can you hear the strutting politicians making hay with that? “Mr. President, it is my sad duty to inform this august body that these developers have no record that they test their code…“) Will they find that developers work at all hours of the day and night, are under hellish pressure and impossible deadlines? Will they find that there are no professional standard, practices, or disciplines. Will they discover that we are all really just a bunch of undisciplined hacks?

The answer to that question will determine which, if any, of those regulatory tools those self-righteous posturing politicians will foist upon us when the accident happens. If they find that we are disciplined, and self regulating, then perhaps they’ll leave us mostly alone. But if they find that we are undisciplined hacks then you know that they’ll impose all manner of horrible regulation upon us.

They might tell us what languages to use. They might tell us what process to use. They might tell us what our working hours must be. They could give us a dress code. They could turn us all into civil servants. They could do anything that want.

We need to get ahead of this one before it happens. Otherwise we’ll work in a government regulated profession. And then life will be hell.