ExtJS 4 命名约定
我正在与同事讨论 ExtJS 4 中类、变量和对象等的正确命名约定,但我们都有不同的观点。
对此有“官方”立场吗?
I was discussing with my colleagues the correct naming conventions for classes, variables and objects etc within ExtJS 4, but we all had differing views.
Is there an "official" stance on this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
绝对有官方立场。等级系统指南的第 2 节对此进行了概述。这是链接: https://docs.sencha.com/extjs/7.2.0/guides/core_concepts/classes.html#core_concepts--classes-_naming_conventions
There absolutely is an official stance. It is outline in section 2 of the Class System guide. Here is the link: https://docs.sencha.com/extjs/7.2.0/guides/core_concepts/classes.html#core_concepts--classes-_naming_conventions
官方,我不确定,但在我看来..
UpperCamelCase
lowercase
小驼峰命名法
Official, I'm not sure, but in my opinion..
UpperCamelCase
lowercase
lowerCamelCase
我最近参加了 Ext.js 4 培训课程(由 Sencha 提供),他们的建议如下:
所以 Hugh 非常划算
I recently attended an Ext.js 4 training course (delivered by Sencha) and their advice was the following:
So Hugh is pretty much on the money
这确实是偏好。休所说的是很好的指导方针,但实际上我更喜欢命名空间全部大写,但我们的应用程序的命名空间相当短,所以它看起来并不荒谬。
It's preference, really. What Hugh said are good guidelines, but I actually prefer namespaces to be in ALL CAPS, but our apps have fairly short namespaces so it doesn't look ridiculous.