Uncle Bob Martin wrote the definitive book on what it means to write clean code. If you want a full treatment, buy Uncle Bob’s book. 1 This is the TLDR (too long didn’t read) version. We also make an attempt to capture the most poignant points that resonate with us.
If you have worked in the software industry long enough, eventually you’ve experienced technical debt. What is technical debt? It is a series of technical trade offs in the name of “we don’t have enough time to do it the right way, right now.” This happens all the time. It happens on deadline, often with projects that had an unrealistic deadline to start with. The best way to think about this is technical debt is the same as credit card debt. Credit cards are great things, for short-term cash flow needs. You need a little extra cash this week, with payday next week. As long as you pay down the credit card fully before the next cycle it is no harm, no foul. Knowing it’s going to cost you more you can also pay off a debt over the course of a month or a couple months. But if you overspend without the ability to pay it back, the interest compounds. It becomes very hard to pay it off for a long time. Now you are in trouble. Your debt becomes unmanageable.
Code behaves the same. Each time a technical debt is ‘charged’, the code becomes more expensive. Well-written code is a beautiful thing, for both the developers and the business. Well-written code is easy to understand. It is easy to work inside, even if you are not familiar with it. It is easy to maintain. It is easy to add features to. The cost of doing something new remains more or less linear. Code with significant technical debt is the opposite. It compounds and the code eventually experiences ‘bankruptcy’. What follows is those dreaded words, “we need a re-write””.
Clean code also significantly increases developer motivation and satisfaction. There are perhaps no more important factors in maximizing productivity than developer motivation and satisfaction. While this cost is harder to measure, it has a multiplying effect. It helps with recruiting new developers.
For the business the benefit of clean code is clear. It is significantly less expensive to produce high quality, innovative products.
Are you ready for clean code?
Contact us we can help.
We don’t work for Bob Martin or Clean Coders. We do however believe in many of the same things. ↩