- 杂项
杂项
不要混用tab和space;
不要在一处使用多个tab或space;
换行符统一用'LF';
对上下文this的引用只能使用'_this', 'that', 'self'其中一个来命名;
行尾不要有空白字符;
switch的falling through和no default的情况一定要有注释特别说明;
不允许有空的代码块。
// not goodvar a = 1;function Person() {// not goodvar me = this;// goodvar _this = this;// goodvar that = this;// goodvar self = this;}// goodswitch (condition) {case 1:case 2:...break;case 3:...// why fall throughcase 4...break;// why no default}// not good with empty blockif (condition) {}
