English 中文(简体)
Sencha Touch - Naming Convention
  • 时间:2024-12-22

Sencha Touch - Naming Convention


Previous Page Next Page  

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

Naming convention in Sencha Touch follows the standard JavaScript convention, which is not mandatory but a good practice to follow. It should follow 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.

Sr.No. Name & Convention
1

Class Name

It should start with an uppercase letter, followed by camel case. For example, StudentClass

2

Method Name

It should start with a lowercase letter, followed by camel case. For example, studentMethod()

3

Variable Name

It should start with a lowercase letter, followed by camel case. For example, studentName

4

Constant Name

It should be in uppercase only. For example, COUNT, MAX_VALUE

5

Property Name

It should start with a lowercase letter, followed by camel case. For example, enableColumnResize = true

Advertisements