Ben Nadel
On User Experience (UX) Design, JavaScript, ColdFusion, Node.js, Life, and Love.
Ben Nadel at cf.Objective() 2017 (Washington, D.C.) with: Dan Sirucek
Ben Nadel at cf.Objective() 2017 (Washington, D.C.) with: Dan Sirucek@dsirucek )

Favor Readable Code Over Idiomatic Code

By Ben Nadel on
Tags: Work

Right now, I work on a team that manages and maintains a large legacy system. This means that I only spend a small amount of time writing new code; and, a very large amount of time trying to understand and improve existing code. But, this isn't so unusual. Eventually, all greenfield projects becomes brownfield projects; and, over the lifetime of an application, we will end up spending more time in maintenance mode than anything else (at least, if you're lucky enough to have successful software).

Of course, I'm not the first person to say this - it's a well known fact that we spend more time reading code than writing it. I only bring this up in order to underscore the importance of readability. And to suggest that you favor "readable" code over "idiomatic" code - when the two are not the same thing.

Idiomatic code builds on the wisdom of the past. Readable code believes in the beauty of the future. These two concepts are not in opposition; and will, in fact, overlap to a large degree. But, when code is "readable" simply because it is idiomatic, then this is an opportunity for improvement.


 
 
 

 
Favor readable code over idiomatic code.  
 
 
 

It's not easy to understand where that line is. And, I'm not suggesting that code always be "dumbed down" for novice developers. I'm only suggesting that there are going to be opportunities to become the rising tide that lifts all boats. And, to embrace those opportunities rather than fight them. And, if you find yourself saying, "Because that's how XYZ developers do it," take a step back and, as nothing more than a thought experiment, consider an alternate perspective.

Tweet This Groovy post by @BenNadel - Favor Readable Code Over Idiomatic Code Woot woot — you rock the party that rocks the body!


Looking For A New Job?

Ooops, there are no jobs. Post one now for only $29 and own this real estate!

100% of job board revenue is donated to Kiva. Loans that change livesFind out more »

Reader Comments

Post A Comment

You — Get Out Of My Dreams, Get Into My Comments
Live in the Now
Oops!
NEW: Some basic markdown formatting is now supported: bold, italic, blockquotes, lists, fenced code-blocks. Read more about markdown syntax »
Comment Etiquette: Please do not post spam. Please keep the comments on-topic. Please do not post unrelated questions or large chunks of code. And, above all, please be nice to each other - we're trying to have a good conversation here.