Browse - Programming Tips - Do names of things matter?
Q. Do names of things matter?
A. Yes. A lot.
If you can make good names of variables, function, modules your
program will nearly write itself. This also includes names of command-line
options and files your programs use.
Obviously follow the naming contentions of your language or environment.
eg in C/C++ MACROS and CONSTANTS are uppercase. Other things aren't.
in Java, Classes are title case. variables start with lowercase.
Be as specific as possible without being over specific.
ProcessFile() is bad since it doesn't say what's going on.
ReadBytesAndCountThem() is over specific.
CountBytes(filename) is just right.
Be consistent. Don't have a function called CountBytes()
and another called CharacterCount()
If you notice that a name of a function (or something) no longer describes
what it does, you should change it. Even if its a big of trouble.
Of course, APIs are an exception.
Here's an article about naming variables.