Friday, February 17, 2017

Ext.js - Naming Convention

Naming convention is a set of rule to be followed for identifiers.
It makes code more readable and understandable to the 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 follows camel case syntax for naming the class, method, variable and properties.
If name is combined with two words, second word will start with uppercase letter always e.g. doLayout(), StudentForm, firstName etc.
Name Convention
Class Name It should start with uppercase letter and followed by camel case E.g. StudentClass
Method Name It should start with lowercase letter and followed by camel case E.g. doLayout()
Variable Name It should start with lowercase letter and followed by camel case E.g. firstName
Constant Name It should be in uppercase only E.g. COUNT, MAX_VALUE
Property Name It should start with lowercase letter and followed by camel case e.g. enableColumnResize = true

No comments:

Post a Comment