2 ms·
Every code base where naming still matters is a code base that is sprouting new functions. What was “clear” two years ago may be unclear today because we have
by hinkley 3y ago
Every code base where naming still matters is a code base that is sprouting new functions.
What was “clear” two years ago may be unclear today because we have four times as many functions. Via the pigeonhole principle, there are no short names that are sufficiently clear, and as X goes to infinity even the medium ones become problematic.
Use a modern IDE with autocomplete. Try to make the beginning of your names as unique as possible. Few people will have to type in the suffixes.
Used to be we would ask other developers what book they would buy all of their coworkers. Answers have changed over time, anything from Brooks to Gamma. But for my money, I would buy them a thesaurus.
If you use the same word in two places in the code, they should be sharing code and data structures. If they don’t, you should use a synonym. Never recycle names, and be sure you aren’t recycling. Many people are wrong here, claiming two things are the same but with no code shared, and in many cases I’ve seen, using two different definitions of the same word.
- deleted 3y ago[deleted]