One of the main factors leading to success is said to be discipline, or in other words, no matter what you do, work at it with all your heart. And in the IT industry, the key to a successful product/business lies in the codes written in a way that not only works effectively and efficiently, but also is easy to comprehend and modify.
“Clean code always looks like it was written by someone who cares.” — Robert C. Martin, Clean Code: A Handbook of Agile Software Craftsmanship
Strictly following coding principles and conventions and avoiding all types of bad and careless codes is not simply just the rules that software developers should comply with. It is the key pillar to business profitability, scalability and security. “Bad code” had a more measurable economic impact than we could ever imagine, according to Stripe’s report in 2018:
- Developers spent 13.5 hours addressing & getting rid of technical debt and 3.8 hours working on bad code (debugging, refactoring, modifying) which took up ~42% of average developer work week.
- Approximately $85 billion dollars loss on global GDP from developer time spent on bad code annually
In short, developers spent an excessive amount of their time struggling with the existing code instead of creating the new one, which cost companies all over the world a ton of money and opportunity cost every year. In this series of “How the bad code hurts your product”, we would like to take you through 3 parts discussing the bad code and its relevant topics:
- Identifying the bad code
- Spot out its cause & effect
- Practical solutions to prevent bad code.
Part 1: Identifying the bad code
It is not easy to give bad code a complete definition in simply a few words as there can be various types of bad code out there. However, we still can have a clear picture about the bad code through these characteristics:
- The lazy expression for unmaintainable or unscalable code blocks, projects, systems,…
- The NO-series: No standards, no best practices, no testing, no DevOps, no documentation, and of course, low-quality
- Hard to understand the codebase / logic without the support from the one who wrote it
- Lack of testing (Unit Testing or Integration Testing for example)
Is the concept still a bit vague to you? Then take out your pen and tick these out, we will give you the quick cheat sheet to detect if you are facing the bad code issue now:
Part 2: Spot out its cause & effect
We have walked through an overview of the tremendous effect of bad code on businesses as well as some characteristics to identify bad code. Let’s continue our Bad code series with more details on its Cause & Effect.
Bad code can exert a huge impact not only on your business/product but also on your work crew, from tech to non-tech teams.
This list suggests a few from many effects bad code may cause:
There are many factors contributing to bad code, but the most common ones to recognize are:
We have walked through the first two parts of the Bad code series that already give you a general understanding about Bad code, including its traits and repercussions. In the third and last section, we’ll offer a few workable ideas to deal with and prevent the problem from occurring in various ways.
Part 3: Practical solutions to prevent bad code
We have divided the solutions for tackling bad code into the following 4 groups:
Even for large tech companies, writing bad code can happen. However, bad code can undoubtedly be fixed and help accelerate the growth of the product with a thorough knowledge of how it is produced and a good plan to deal with it.
CLICK HERE to download full PDF file