3 ms·
When naming things is hard, it's exactly the reason why you should stop, think, and find a good, fitting name. If you have hard time naming something in your c
by nine_k 11y ago
When naming things is hard, it's exactly the reason why you should stop, think, and find a good, fitting name.
If you have hard time naming something in your code, chances are it's because you have a nebulous understanding of that elusive thing. This is obviously bug prone. It's usually a good idea to spend a few minutes searching for a good, precise, descriptive name, and add enough comments if the entity being named is not a temporary variable.
Doing so not just makes later code maintenance easier, it tidies up your understanding and can even lead to finding a bug or another problem (happened to me more than once).
- tetha 11y agoIn my team, we're starting to take naming problems as a very, very red flag. Especially if the name makes sense for half the team, and no sense for the other half. In the most extreme case, we've taken like half a day off with the entire team to discuss just about everything. We went from a name to one of our software to our architecture to our domain and it was just half a day to a day of discussion and merging understandings. After this, we spend another half a day to a day just cleaning up a huge mess of potential bugs, and after that, naming was simple. And now, a few month later, hell it was worth it.