Igor's Techno Club

How to choose a better name for a variable

Remember the situation when you were working on some code refactoring, and you wanted to find a particular class. You were familiar with the code and vaguely remembered the class name, but when you tried to search for it, IDE showed you no results. After a few iterations, you finally were able to find the class, which had a completely different name than the one you searched for before.

When this happens to you, usually, the first name that comes to your mind is the better name for the class, so change to it right away.

The same approach applies even on a more abstract level, like this advice from here:

If you're looking for something in your house and then you finally find it, when you're done with it, don't put it back where you found it, put it back where you first looked for it.

#codequality #dev #naming