DEV Community

Michael Mangialardi
Michael Mangialardi

Posted on

Clean Code is About Reducing Complexity (Not Improving Readability)

When it comes to clean code, there is often an assumption that clean code means readable code.

In other words, the aim of clean code is usually assumed to be making the code as readable as possible.

More readable code is almost always cleaner code. However, it is not at the heart of clean code.

The aim of clean code is to produce simpler code. Code should be reduced to the lowest level of complexity possible while still providing an adequate solution.

So, how can we reduce complexity in software?

The short answer is removing as much cognitive load as possible.

To put it another way, the less thinking that has to be done to make a change the better.

Top comments (1)

Collapse
 
jordanplows profile image
Jordan Plows

Hey Michael,

I think that both can be achieved, I think you can have readable code with minimal complexity. Although I get what you are saying here