Show of hands.
How many of you have a library, class, or directory in your current project called
Bonus points if you have both!
Actually, bonus points if you have neither.
I don’t like this naming pattern, for a few reasons:
The name tells me nothing. Literally all code exists to help (otherwise it wouldn’t exist). And all code provides utility (otherwise it wouldn’t exist). So from a naming standpoint, we may as well call such a unit of code
whateveror… well, I’m sure you get the idea.
“Catch all” names like this tend to… catch all. That is, they tend to gather all sorts of random, unrelated things over time. This makes it difficult to find what you’re looking for, which leads to the next problem…
These names promote code duplication. When you can’t find a function that does your neat little thing, you create a new one in a local
helpersclass, without realizing that it does, indeed, already exist, in some other helpers class. Now you have the same, or nearly the same, functionality in two (or more) places…
It’s just kinda lazy. The same as naming a variable
xor a function
do(). I’m sure you can do better. What is the variable/function/class doing? Name it accordingly!
If you enjoyed this message, subscribe to The Daily Commit to get future messages to your inbox.