Ext.js - Naming Convention


Advertisements

Naming convention is a set of rule to be followed for identifiers. It makes the code more readable and understandable to other programmers as well.

Naming convention in Ext JS follows the standard JavaScript convention, which is not mandatory but a good practice to follow. It should follow the camel case syntax for naming the class, method, variable and properties.

If the name is combined with two words, the second word will start with an uppercase letter always. For example, doLayout(), StudentForm, firstName, etc.

Name Convention
Class Name It should start with an uppercase letter, followed by camel case. For example, StudentClass
Method Name It should start with a lowercase letter, followed by camel case. For example, doLayout()
Variable Name It should start with a lowercase letter, followed by camel case. For example, firstName
Constant Name It should be in uppercase only. For example, COUNT, MAX_VALUE
Property Name It should start with a lowercase letter, followed by camel case. For example, enableColumnResize = true
Advertisements