- 主题:同事不知道从哪里学的习惯
所以现在 coffee 也是这样子是吧。
【 在 dhcn (coder) 的大作中提到: 】
: 不加分号好像是目前某些激进派的Style。
--
FROM 183.251.100.*
可能是从coffee学过来的。
【 在 hgoldfish 的大作中提到: 】
: 所以现在 coffee 也是这样子是吧。
:
--
FROM 124.42.13.*
好像有个业界JS技术大佬公开表态:他不用封号。
【 在 hgoldfish 的大作中提到: 】
: 所以现在 coffee 也是这样子是吧。
:
--
FROM 124.42.13.*
真是异端啊。。应该烧死。
【 在 dhcn (coder) 的大作中提到: 】
: 好像有个业界JS技术大佬公开表态:他不用封号。
--
FROM 183.251.100.*
我就是不写分号的,没吃过亏。压缩也都很顺利。
你是写分号还吃过亏,不如转到不写分号的阵营。
另外不写分号还可以少按很多次键盘
,这么一比较写分号简直毫无理由。
【 在 dreamingGirl 的大作中提到: 】
: 不加分号compress可能出问题,加上肯定不会,为何不加。
: 这个吃过多次亏了,开发环境没事,到发布后compress之后的代码有错误,遇到多次了。
: 估计任何公司都不会出分号不加的情形的规范吧。
: ...................
--
FROM 45.56.87.*
当然是不写分号出的问题啊。
【 在 zxdong262 (zxd) 的大作中提到: 】
: 我就是不写分号的,没吃过亏。压缩也都很顺利。
: 你是写分号还吃过亏,不如转到不写分号的阵营。
: 另外不写分号还可以少按很多次键盘
: ...................
--
FROM 106.39.39.*
但是 是在 “写分号代码风格”下出的“不写分号”问题,对吧?
转到 “不写分号代码风格”,也许就不会出“不写分号”问题了啊
当然这都是瞎扯,我觉得出问题的是写代码和执行代码风格的人,而不是代码风格
看下三位大神的代码风格
http://dailyjs.com/2012/01/12/style/
tj (author of Express, Jade, Stylus, Koa, Mocha, and 500+ others libs) 写分号,逗号前置
Isaac Z. Schlueter (author of npm)不写分号的主要推动者
Ryan Dahl, creator of Node 写分号
【 在 dreamingGirl 的大作中提到: 】
: 当然是不写分号出的问题啊。
--
修改:zxdong262 FROM 45.56.87.*
FROM 45.56.87.*
`void` is a unary operator, takes any value, returns undefined
`void` is reserved keyword, whereas undefined is a property of global/window
object and can be overriden in local scopes
【 在 hgoldfish (老鱼) 的大作中提到: 】
: 2是这样的,我们一般写:
: function ($scope) {
: $scope.brand = 'lskjdfls';
: ...................
--
FROM 180.173.119.*
jshint warns on `return x=y` --- "do you mean return x==y?"
am against 2: return value of a function must make sense and match the
function's expected usage; in this case the function is expected to
perform mutations, and its return value is ignored, so it should not
`return aValue`.
`return;` is however acceptable, when used to indicate an early exit.
【 在 hgoldfish (老鱼) 的大作中提到: 】
: 2是这样的,我们一般写:
: function ($scope) {
: $scope.brand = 'lskjdfls';
: ...................
--
FROM 180.173.119.*