Skip to content

Instantly share code, notes, and snippets.

@panfu
Last active September 6, 2015 02:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save panfu/2ff4a0a3e95a7ddcf1c8 to your computer and use it in GitHub Desktop.
Save panfu/2ff4a0a3e95a7ddcf1c8 to your computer and use it in GitHub Desktop.
变量名称大小写之争,此处明了。
##### 变量大小写的结论
* 构造器 Class、Object 用 TheSomeone // 先祖的权威
* 方法名称 doSomething // 动宾,够醒目
* 文件名称 the_file // 网络传输可能会忽略大小写、可读性
* 普通变量 some_variables // 可读性
* CSS class: the-class-name
* CSS id: the_some_one
[访问讨论现场](http://stackoverflow.com/questions/1008230/what-is-the-best-practice-casing-style-for-javascript-why)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment