- Inside Macintosh: Programmer's Guide to MacApp /
- Preface - About This Book
Naming Conventions in MacApp Code
Code in the MacApp class library and sample applications, as well as sample code used in this book, follows certain naming conventions:
- Each distinct word in the name of a variable, constant, or routine begins with an uppercase letter (for example,
CloseAndFree).
- Names of variables and constants begin with a lowercase letter.
- Global variable identifiers begin with a lowercase
g (gConfiguration).
- Command constants begin with a lowercase
c (cUndo).
- Other constants begin with a lowercase
k (kWantHScrollBar).
- Fields (also known as instance variables) of object classes begin with a lowercase
f (fDocument).
- Fields that are static global variables begin with a lowercase
fg (fgDragDropSession).
- Compile-time variables begin with a lowercase
q (qDebug).
- All method names begin with an uppercase letter (
Enable).
- Most of the classes in MacApp descend from
TObject and begin with an uppercase T (for example, TApplication). Exceptions include
- C++ utility classes (such as
CIterator), which begin with an uppercase C
- the mixin classes used for multiple inheritance (
MScriptableObject), which begin with an uppercase M
- a small number of memory and utility classes (
BestFitBlock, PatchEventAvail), which do not have a common beginning character
© Apple Computer, Inc.
25 JUL 1996