On 17.04.2011 21:07, Garrett Smith wrote:
On 4/17/11, Brendan Eich<[email protected]> wrote:
On Apr 17, 2011, at 10:52 AM, Claus Reinke wrote:
[TLDR]
ASI is not going to be removed. I don't know why you think it could be.
Why not? Iif developers would stop doing that then eventually, can't
it be removed?
It is not hard at all to write code that does not rely on ASI.
The question is not that it's hard or not. IMO an explicit semicolon is
really a syntactic noise in the language. In goes to the early era of
C/Pascal, etc. Since usually, a programmer puts a one logical sentences
per line -- *for what* you need additional statement/expression
termination besides the new line itself? The useless actions in this
case can be compared with masochism.
So it's a noise. But a completely different thing is the implementation
of ASI and all subtle/tricky/buggy cases related with it which exactly
causes dislike of the ASI. If the ASI had been implemented perfectly --
will you still continue to put this noise explicitly? Why?
IMO, the semicolon should be inserted only when there is ambiguous
syntactic construction, or, e.g. when you want to put more than one
sentence in one line. It's like a grouping operator -- usually we use it
when we need to solved the precedence conflict, we don't use it manually
everywhere, because it's, obviously, noisy and useless. The same with
this semicolon. If we need specify such a place -- we put it. If we need
to prolong the statement to several lines -- use slash (or anything
else) -- but these are rare cases.
Personally I always used semicolon when was programming on JS, but --
only to support style guide accepted in the company. I think I wouldn't
now, however, yeah, there're very subtle case because of current
implementation of ASI exactly in JS which will cause the issues. So
still I'd prefer to use semicolon in JS. However, I wouldn't in
Coffee/Ruby of course.
("Deprecated production: missing semicolon, line 29").
It's seems to me as an old era of typing-lovers. The machine should know
where I *assume* the ending of a statement. It's not me who should do
this dirty job every line! But when the machine is not smart enough, I
can help it by placing the semicolon explicitly and these should be rare
cases.
Dmitry.
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss