Why we don't write clean code

Pretty much for the same reason the 2020 Beirut explosion happened

In 4 August 2020, a huge explosion devastated Beirut. One of the largest peacetime explosions in history, it killed more than 200 people, injured 5 thousand, and destroyed the port, two ships, three hospitals, and many thousands of homes. A large fire was burning before the explosion and people were filming it on their phones, resulting in the explosion being captured from various distances and angles—a breathtaking sight shaming Hollywood.

Why did the explosion happen? Because dangerous material had been unloaded by a ship whose owner had gone bankrupt. It belonged to no-one. There were many agencies involved—port, customs and courts. Letters urging to do something had gone from one to the other, but the load remained there for six years.

Why?

Pretty much for the same reason we delay applying clean code procedures. For the same reason that we often don’t backup our data properly, or we don’t secure our systems and processes.

When we have a hard problem but it doesn’t get in the way, it’s easier to postpone it for tomorrow. There are always more urgent things that need our attention. Until disaster hits, that is.