📅  最后修改于: 2020-10-19 03:00:50             🧑  作者: Mango
命名约定是标识符要遵循的一组规则。它也使代码易于其他程序员阅读和理解。
Sencha Touch中的命名约定遵循标准的JavaScript约定,这不是强制性的,而是遵循的良好实践。应该使用驼峰式语法来命名类,方法,变量和属性。
如果名称由两个单词组成,则第二个单词将始终以大写字母开头。例如,doLayout(),StudentForm,firstName等。
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 |