Monday, February 1, 2010

Naming conventions

General naming guidelines: •Concatenate words to create names.
Use mixed-cases (upper and lower case) when you concatenate words to distinguish between each word for readability. For example, select myPelican rather than mypelican.

Avoiding reserved words and language constructs:Reserved words include keywords in the ActionScript language.

Naming variables: Adds code completion functionality, which speeds up coding.


Naming constants:Constants should be uppercase.

Naming Boolean variables: Start Boolean variables with the word "is" (because a Boolean value either "is" or "is not" because of its nature). Therefore, you might use the following for whether a baby is a girl or not (which is a Boolean value):



Naming functions and methods:•Start function and method names with a lowercase letter.

Naming classes and objects:•Class names are usually nouns or qualified nouns.
A qualifier describes the noun or phrase. For example, instead of "member," you might qualify the noun by using NewMember or OldMember.

Naming conventions:•They make your code readable so that you can immediately identify a variable's data type. This can help students, those learning code, or developers unfamiliar with your code.

Naming packages:•Put the prefix for a package name in all lowercase letters.
For example, com, mx, or org.

Naming interfaces:•Interface names have an uppercase first letter.
This is the same as class names.

Naming custom components:•CheckBox
•ComboBox
•DataGrid
•DateChooser
•DateField
•MenuBar