Forem

Tonny Kayage for ClickPesa

Posted on • Edited on

4 2

Clean Code: Introduction to clean code

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

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.

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

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read more →

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay