Stop using "util" in the name of classes and folders NOW!
 
"The moment you create a `utils` directory, it will become a dumping ground where otherwise good modules go to die. Try it, you'll see." - +Wil Moore (@wilmoore)

There’s nothing wrong with the word util. The problem is that it’s very general and don’t add any value to the name. The majority of the code we write is general or utilitarian, and overusing it reduces the readability of your code. It will also result with classes that are trying to do too much. In some cases it’s used because of laziness. If banned, the codebase will have better named classes and folders.

"If I ever get to defining a coding standard, the following words will be forbidden as parts of any names: ‘helper,’ ‘wrapper,’ ‘manager,’ and ‘service.’ Everybody who used them would be excommunicated right away and would no longer receive a supply of pizza, coke and beer!" - +Gaylord Aulke 

My buddy Gaylord is taking this idea to the extreme. His idea has merit. When the Zend Framework guys worked on the rewrite for v2, one of the first orders of business was fixing the issues they had  with naming "helper" classes. As the v1 codebase evolved, names like "helper" and "wrapper" were used to mean different things in different parts of the framework. My guess is that these classes' names were too general leading different people to place different meanings on the same words or the inverse, two people would pick two different words to mean the same thing. The Zend Framework team had to take time and sort out this mess before they could go forward.

"@wilmoore I banned the use of util and the like. I would allow if you could convince me it was the best choice. No one ever did." - Sam Hennessy (Me)

In programming you should create rules. Having a set of rules helps people be productive. There are many right ways to do things but sometimes it's best to all agree on one right way. I also think all rules in software are made to be broken. 

When it comes to using like util, helper or manager, add resistance. By default, these words should not be allowed. If someone wants to use them they must plead the case to someone appointed as the judge of what’s acceptable. If the judge decides the wording is okay, create a definition of its specific meaning and allowable use on a wiki page for the project.

The best way to enforce this is through peer code review. Adding this rule is going to be tricky if you have a legacy codebase. You need to put the brakes on any further use of these labels and count any existing use of such as technical debt. The end result will be a much more readable codebase.

#programming  
Photo
Shared publiclyView activity