Clean Code

Muhammad Asad Attari
2 min readJul 7, 2022

Code is Really a Language in which we ultimately express the requirements. If you are a programmer for more than two to three years, you have probably been significantly slowed down by someone else’s messy code.

The Art of Clean Code?

You might want to write clean code but writing clean code is like painting a picture, most of us know when a picture is painted well or badly, but it doesn’t mean how to paint a picture. So, being able to recognize clean code from dirty code doesn’t mean that we know how to write clean code. So, come to the point What is Clean code?

Bjarne Stroustrup, inventor of C++

I like my code to be elegant and efficient. The logic should be straightforward to make it hard for bugs to hide, the dependencies minimal to ease maintenance, error handling complete
according to an articulated strategy, and performance close to optimal so as not to tempt people to make the code messy with unprincipled optimizations. Clean code does one thing well.

Grady Booch, author of Object Oriented Analysis and Design with applications:

Clean code is simple and direct. Clean code reads like well-written prose. Clean code never obscures the designer’s intent but rather is full of crisp abstractions and straightforward lines of control.

Michael Feathers, author of Working Effectively with Legacy Code:
I could list all of the qualities that I notice in clean code, but there is one overarching quality that leads to all of them. Clean code always looks like it was written by someone who cares.

Ron Jeffries, author of Extreme Programming:

In recent years I begin, and nearly end, with Beck’s rules of simple code. In priority order, simple code:
• Runs all the tests;
• Contains no duplication;
• Expresses all the design ideas that are in the
system;
• Minimizes the number of entities such as classes,
methods, functions, and the like

So, we read the opinions of some experts. It’s time to learn how to write clean code. In the next article i will provide Naming strategies how to name the variables, constants, functions, classes and methods name.

Reference: Clean Code A Handbook of agile software Craftsmanship

--

--

Muhammad Asad Attari

Software Engineer | Full Stack Developer | DevOps Engr.