Software developers have a stereotype of being intellectual nerds who sit in their parents' basements coding all day. This stereotype might have been true 20 years ago, but in the 21st Century that stereotype is beginning to change.
Software developers are now being taken seriously as an integral part of modern society, but not all developers are equal.
What makes a developer a good developer? As a product owner, you might look into education and years of experience. However, I would like to explore the idea that the ability to write clean code is what separates good developers from average ones, and I advise you to take this into consideration when choosing your next development team.
What is clean code?
To understand what clean code means, it might be easier to start at the end, on what clean code results in. When a developer writes clean code the result is a product which is maintainable, extensible, and transferable.
Maintainable code is a code which has been written in such a way that making small changes to it is easy, and does not affect other parts of the code or product. In other words, a code should not be tightly coupled (to other parts of the code).
Extensible code allows adding new features (large or small) to an existing code without needing to make massive changes to the previous one. Extensible code is normally written in a modular fashion, where it is split up into smaller chunks of code, each one performing a specific task.
Transferable code allows the product owner to take the code and give it to a new developer without much or any hassle. The code is easy to read and understand without much or any input from the previous developer.
What is the effect of using clean code vs. non clean code on my project.
- Saves Time - Although its true that it takes longer to write code in a modular way, as a projects' codebase grows larger, clean code is much easier to work with, saving time over the duration of the project.
- Saves Money - Since you are saving development time, you can go to market quicker and spend less money on development costs.
- Higher Code Quality - To write a clean code, the developer must separate concerns or write it in a modular way. This means that if code is changed in one place, it will only affect that specific code, not impacting other areas. This results in fewer unexpected ripple effects from changing code.
- Happier Team - Developers like to work with easy codes. Clean code makes adding new features a breeze. If you like to have your product delivered in a timeous manner and at a high quality standard, using clean code will help by mitigating unexpected bugs, as well as delivering a code quickly.
- Less Code Debt - Code debt is a concept in software development that reflects the implied cost of additional rework caused by choosing an easy solution instead of using a better approach that would take longer. Using clean code will help you to avoid extra work and costs.
- Requires Strong Developers - Witing messy code is easy, but writing clean code requires the necessary know-how. Developers who are dedicated to their craft and take clean code seriously are hard to come by.
- Can Be Tedious - Writing clean code is more difficult to write than messy code. For this reason, even strong developers get lazy and let the code slip sometimes.
- Sometimes Quicker - If you need to deliver a feature extremely fast, messy could can help you with that.
- Costs Time - Even though is quicker to write, messy code is difficult to extend and maintain. Sometimes it can be referred to as spaghetti code. This is a nice analogy because it describes how code can be entangled and how moving or changing one piece will affect the other ones. If that happen, the code will need to be refactored, increasing costs time over the lifetime of the product.
- Costs Money - The longer the development time, the more money you will have to spend on it. Another area where messy code costs money is on bugs. If you have bugs in a product, it can create a sense of unreliability and a potential loss of users.
- More Code Debt - Messy code will need to be changed at some point, there's no avoiding it. If the code is not changed and the mess continues, it will only take longer to clean up in the future, generating more debt.
- Unhappy Team - With all of the issues above, the development team will not be very happy and neither will you.
How do I know if my project has clean code?
As a product owner, It can be difficult to measure clean code, but there are some methods you can use to identify and mitigate the case of a messy code:
- Tight coupling: If you notice that bugs are introduced into the product in areas not related to the code being worked on, after a round of changes, it is a sign of tight coupling. This code should be refactored to decouple the features.
- Simple tasks taking a long time: If the development of seemingly simple tasks is taking a long time to implement, this can be a sign of messy code. However, this statement needs an asterisk because it could also be caused by other factors such as environmental limitations, programming language limitations, framework limitations, etc. That being said, your developer should raise these limitations with you before starting work on the previous feature/task.
- Don't be fooled by the years or experience: A developer may have many years of experience picking up bad habits. Developers are typically lazy by nature and want to find the simplest solutions. This is great for problem solving, however, this trait can translate badly into writing code. As writing a clean code requires more effort, choosing a developer with a good work ethic as well as strong problem solving skills is the ideal combination.
As a product owner, choosing your development team can be a daunting task. However, if you choose a team that prioritizes writing a clean code as one of your main criteria, it will definitely help you to ensure the success of your development project.