Descriptive Name to Procedures

When naming procedures, try to choose a name that describes exactly what the procedure does. If the procedure is a function that returns a value, indicate what the return value is in the function name (for example, GetUserName). Try to use good verb-noun combination to describe firstly, what action the procedure performs, and secondly, what the action is performed on (for example SearchDirectory, MakeUniqueFileName, or LoadSettings). Studies show that, since procedures are generally more complicated than variables, good procedure name tend to be longer than good variable names. Fifteen to thirty characters for a procedure name is perfectly acceptable (they can be a bit longer since you generally don’t type them nearly as much). If you are having trouble giving your procedure a good name, that might be an indication that the procedure is not narrow enough – a good procedure does one thing, and does it well.

That said, if you are writing scripts for your WebPages that will be downloaded to a user’s browser, it is something necessary to use shorter variable and procedure names. Longer names mean larger files to download. Even if you sacrifice some readability in order to make the file smaller, you can still make an effort to make the names as descriptive as possible.