Clean Code: Introduction to clean code
Tags: cleancode, clean
Published: 2022-08-05 12:44:27


At ClickPesa we strive to write scalable, performant and maintainable code. We try to maintain great standards inorder to enhance the quality of our products.

I have recently picked up the "clean family” books written by Robert C Martin. The books are Clean Code, Clean Architecture and Clean Coder. I will share my thoughts and insights i gain from these books as i go through them while also trying to incorporate the lessons i deem workable. I have added links to where you can also get them in the conclusion section of this article depending on your favorite mode of consumption (Audiobook or Kindle).

## What is Clean Code
These are principles, patterns, and practices of writing readable and maintainable code. Clean code can be easily picked up by any team member to further add features. This helps create uniformity in the team in terms of Coding style and patterns. 

## Importance of Clean Code

1. Uniformity of code among the team contributing to the same codebase. As mentioned earlier stick to patterns already existing in the codebase. Unlike building components that are dissimilar. This aids in onboarding new team members into the team.

2. Swappable technologies can be easily integrated/removed from the codebase without affecting the business logic. Let's say we have a system that utilizes a certain Queuing technology in our application but a recommendation from a consultant wants the team to utilize emerging exciting technology. This new exciting technology can be easily introduced without touching any logic that utilizes it if clean code was used.

3. Software development is a continuous process and requirements are ever-changing. It is a measurable task with an associated cost to each feature developed. The cost for each modification of the codebase should always be constant over time. Poorly written/organised codebases are characterized by more escalating costs of change with relation to time. The graph below explains such phenomena:
![Cost vs Time](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yr4g8komap5ovwncoe45.jpeg)
 

As the graph explains developers that maintain clean code throughout their development cycles usually maintain speed and efficiency in software delivery.

## Closure
As a professional developer, your job is to maintain high code quality and structure. Business teams usually pressure developers into delivering services but you should always maintain your stance of maintaining great standards. At the end of the day, the same business personnel pressuring you to produce more deliverables without standards will come and ask you to modify the same codebase with them expecting it to be a trivial task simply because you have already implemented some parts of the feature. To them, you are simply adding to what exists.

In the next chapter we will dive deep into more concepts explained the book and how we have tried to use them in our projects at ClickPesa. 

Additional resources that i also found useful including the books from amazon.

- [Clean code audible](https://www.audible.com/pd/Clean-Code-Audiobook/B08X7KL3TF?qid=1659700007&sr=1-1&ref=a_search_c3_lProduct_1_1&pf_rd_p=83218cca-c308-412f-bfcf-90198b687a2f&pf_rd_r=VTDS2083DYK37XV8ZB3M)
- [Clean code kindle version](https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship-ebook/dp/B001GSTOAM)
- [Clean code summary gist](https://gist.github.com/wojteklu/73c6914cc446146b8b533c0988cf8d29)

For the next chapter of this series or similar articles like this please checkout our Engineering Blog available on:

- [Medium](https://medium.com/clickpesa-engineering-blog)
- [Devto](https://dev.to/clickpesa)
- [Hashnode](https://clickpesa.hashnode.dev/)