Naming conventions refers to the set of guidelines or agreed upon rules specific for a programming language that are recommended for choosing the character sequence representation used as identifiers to denote variables, types, methods, classes, and other entities in the source code and documentation.
Normally, code may be written only once but it will be read many times. Naming conventions are important because they improve the communication, code integration, consistency and clarity of your code.
There are many well stablished naming conventions in the programming community. Combining Java, IB and personal preferences the following naming conventions will be followed in this class:
Naming: Camel Case style will be used for all identifiers.
Variables
all instance, class, and class constants are in mixed case with a lowercase first letter. Internal words start with capital letters. Variable names should not start with underscore _ or dollar sign $ characters, even though both are allowed.
Variable names should be short yet meaningful. The choice of a variable name should be mnemonic- that is, designed to indicate to the casual observer the intent of its use. One-character variable names should be avoided except for temporary "throwaway" variables. Common names for temporary variables are i, j, k, m, and n for integers; c, d, and e for characters.
int i;
char c;
double myWidth;
Constants
The names of variables declared constants should be all uppercase with words separated by underscores ("_").
static final int MIN_WIDTH = 4;
static final int MAX_WIDTH = 999;
static final int GET_THE_CPU = 1;
Classes
Class names should be nouns, in mixed case with the first letter of each internal word capitalised (Camel Case Style). Try to keep your class names simple and descriptive. Use whole words-avoid acronyms and abbreviations (unless the abbreviation is much more widely used than the long form, such as URL or HTML).
class Raster;
class ImageSprite;
Methods
Methods should be verbs, in mixed case with the first letter lowercase, with the first letter of each internal word capitalized.
run();
runFast();
getBackground();