Ben Nadel
On User Experience (UX) Design, JavaScript, ColdFusion, Node.js, Life, and Love.
Ben Nadel at cf.Objective() 2014 (Bloomington, MN) with: Jeff McDowell and Joel Hill and Jonathan Rowny and Shawn Grigson and Jonathan Dowdle and Matt Vickers and Christian Ready and Asher Snyder and Clark Valberg and Oscar Arevalo and David Bainbridge and Josh Siok
Ben Nadel at cf.Objective() 2014 (Bloomington, MN) with: Jeff McDowell@jeff_s_mcdowell ) , Joel Hill@Jiggidyuo ) , Jonathan Rowny@jrowny ) , Shawn Grigson@shawngrig ) , Jonathan Dowdle@jdowdle ) , Matt Vickers@envex ) , Christian Ready@christianready ) , Asher Snyder@ashyboy ) , Clark Valberg@clarkvalberg ) , Oscar Arevalo@oarevalo ) , David Bainbridge ( @redwhitepine ) , and Josh Siok@siok )

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 Great article by @BenNadel - Favor Readable Code Over Idiomatic Code Woot woot — you rock the party that rocks the body!


Reader Comments