Code smell has gone stinky

Front end engineer at Red Ventures is Edward Granger and he’s not happy — so what’s his problem?

Granger says he doesn’t like the term ‘code smell’, which is being increasingly popularised.

But what does the term mean in the first place?

Enterprise software commentator Martin Fowler gives us a definition for code smell when he says that: a code smell is a surface indication that usually corresponds to a deeper problem in the system.

“[Code] smells don’t always indicate a problem. Some long methods are just fine. You have to look deeper to see if there is an underlying problem there – smells aren’t inherently bad on their own – they are often an indicator of a problem rather than the problem themselves,” writes Fowler, in this posting.

But Granger doesn’t like the term.

He says that every organisation will have unique needs and values that determine their standards for code quality. However, what is non-negotiable is to place code quality over people or the task at hand.

Ain’t no right-wrong binary deal

Granger contends that to evaluate code as categorically right or wrong does not help engineers perform their jobs any better. In fact, it may be the fastest way to zap team morale.

“When we work on issues of code quality, we should focus on eliminating the extraneous cognitive load in our codebases before scrutinising our peers with textbook scruples. When we focus our attention on correcting smelly code, we end up littering pull requests with critiques completely unrelated to the problem at hand,” writes Granger, in his own rebuttal blog that aims to whiff-away the term itself.

He goes on to say that the term code smell isn’t just pejorative – it’s misleading. 

“Code smells are never an indication of failure. They’re patterns that will inevitably emerge over time – no matter how good of a developer you are. Every engineer on earth is going to find imperfect patterns in their code… because we’re finding solutions in an imperfect world. It’s often that we truly don’t understand what we wanted our code to be until after we’re done writing it,” notes Granger.

Is Granger being a snowflake and trying to care about people and feelings too much? Perhaps not… he certainly knows his cognitive loads from his scope resolution operators and you can read his original post (linked above) to assess your own position on code smell.

Red Ventures is a portfolio of digital businesses that focuses on performance-based digital marketing and integrated e-commerce, data science and other bespoke technologies.

Source: Wikipedia

Join the conversation

1 comment

Send me notifications when other members comment.

Please create a username to comment.

this is a great article!  Edward Granger is amazing.  Thank you for sharing
Cancel

-ADS BY GOOGLE

SearchCIO

SearchSecurity

SearchNetworking

SearchDataCenter

SearchDataManagement

Close