[Previous] [Contents] [Next]

Methods


Use Pascal casing on all methods. Methods are meant to act-they carry out work. Therefore, let the names of your methods depict what they do. Examples of this are PrintInvoice and OpenDatabase.

In the case of methods that will be used in Boolean expressions, prefix the method with a verb that indicates what the method will do. For example, if you have a method that will return a Boolean value based on whether a workstation is locked, name the method something like IsWorkStationLocked. That way, if the method is used in an if statement, its meaning will be much clearer, as shown here: -

if (IsWorkStationLocked) ...

[Previous] [Contents] [Next]