When Readability is a Skill Issue

For some time, I’ve been noticing a rather concerning belief that readability (ease of understanding or clarity of intention) is the primary measure of good software. While readable code is good and most arguments for it are relatable, readability is not remotely the most important quality to strive for. Readable code is better than unreadable, messy code -- that is really all.

As with many things, the pursuit of “readability” is not just about benefits but also costs. I see this pursuit getting so misguided that developers completely confuse it with its purpose. An important value of software is its ability to be changed, and to this end, readability is valuable. Unfortunately, the value of readability can be so elevated that vital aspects of software can get sacrificed. As Einstein is quoted to say, “... as simple as possible but not simpler”. Readability, your ability to read and understand, is not so important that essential software qualities must be traded off.

Readability is often brought up in 2 situations: (1) when faced with messy code or (2) when faced with complex code. Inability to comprehend what can be is a skill deficiency, remediable by a fair bit of study and perseverance. The increase of “over-engineering” critique appears to be, at least in part, also driven by the self-serving demand for code to be readable. There is a widespread preference for “readable” under-engineered code. Yet, over-engineering (or under-engineering for that matter) does not even necessarily relate to complexity or comprehensibility. Over-engineering is improving a solution when it costs more than it benefits, while under-engineering is neglecting to improve a solution when it benefits more than it costs. This means, declarations of over-engineering due to inability to comprehend are in fact misguided claims.

Readability serves a purpose, but using it as a cop-out from proper software design and sensible architectural decisions can lead to poor quality software. Rather than hastily conclude over-engineering, take the time to really assess whether it is so. Is it difficult to read because you don’t understand, or do you understand it is difficult to read?