Skip to main content
hhow09's Blog

Talking about code quality

What is code quality? #

Definitions of code quality is pretty subjective and different from company to company. Developers also have different opinions on what is good code.

In general, code quality is a way to talk about how correct, readable, reusable, maintainable and efficient code is.

Why is code quality important ? #

How to measure code quality? #

Quantifying code quality is challenging, but these metrics provide useful signals:

How to maintain code quality? #

Correctness #

In practice #

Readability #

Code should be easy to understand, review, and maintain.

Complexity #

Complexity directly impacts readability.

A Philosophy of Software Design by John Ousterhout explores software complexity (e.g. cognitive load) and strategies to reduce it.

In practice #

Reusability #

In practice #

Maintainability #

Maintainability is about how easy it is to refactor and extend the code.

In practice #

Efficiency #

Efficiency can be defined as, using the resources optimally where resources could be memory, CPU, time, files, connections, databases etc.

In practice #

Further Reading #

References #