命名约定是标识符要遵循的一组规则。
它使得代码对于其他程序员也更可读和可理解。
ext js中的命名约定遵循标准javascript约定,这不是强制性的,而是遵循的良好做法。
它应该遵循camel case语法命名类,方法,变量和属性。
如果name与两个单词组合,则第二个单词将始终以大写字母开头。 dolayout(),studentform,firstname等。
名称 | 惯例 |
---|---|
class name | 它应该以大写字母开头,然后是camel case e.g. studentclass |
method name | 它应该以小写字母开头,然后是camel case e.g. dolayout() |
variable name | 它应该以小写字母开头,然后是camel case e.g. firstname |
constant name | 它应该是只有大写,例如 e.g. count, max_value |
property name | 它应该以小写字母开头,然后是camel case e.g. enablecolumnresize = true |