On 4/18/11, Claus Reinke <[email protected]> wrote:
>> The only places where semicolons are ever used in the Node.js package
>> manager are in the 'for' loops headers and at the *beginning* of the lines
>> that would be interpreted incorrectly because of the lack of the semicolon
>> at the end of the *previous* line - for example see:
>> https://github.com/isaacs/npm/blob/master/lib/utils/read-json.js#L320-L336
>>
>> There are no semicolons at the end of lines *at all*.
>>
>> Also the commas in multi-line arrays and parameter lists are always
>> written
>> at the *beginning* of lines so Node also depends on the ASI *not*
>> inserting
>> semicolons if the next line starts with a comma or other operator.
>
> Thanks. It is useful to have such concrete examples.
>
If you can think it, there is a porn for it.

]...]
>
> [aside: it would be nice to know who the committee members
>     are, and what the process is for starting an official proposal]
>
Who are the committee members?

> For the specific case of ASI, Brendan has explained the issues
>
> https://mail.mozilla.org/pipermail/es-discuss/2011-April/013794.html

Restricted productions are the most benign cases. How ASI changes
program behavior WRT unrestricted productions is bigger problem.

> In brief, there is no way simply to take away ASI, and any
> attempt to introduce a less troublesome variant of ASI will
> have to offer a way to deal with existing code.
>
The number of developers advocating ASI as a "best practice" can't be
stopped either.

> 'legacy' code here refers not to ancient, badly written code
> but simply to code using the current ASI, which is a legacy
> from the point of view of any revised ASI.
>
Right.

> ASI reform would not have the intention to force coders to
> add semicolons everywhere, it would "merely" try to make
> the rules of syntax easier to understand for coders and less
> troublesome for language designers. The goal would be to
> avoid unnecessary syntax while also avoiding unnecessary
> worrying about how the mechanism works.
>
> As a coder, you really don't want to add semicolons to
> avoid ASI traps, as in line 232 of your example
>
>     ;["dependencies", "devDependencies"].forEach(function (d) {
>
Exactly. Because otherwise, that array might be property accessor.

Why do I want to have to worry about what might have been omitted? No,
I want to worry about what the code says. I consider a statement
terminator to be just that; when I read it, I see end of statement.
don't want to read beginning of statement preceeded by empty
statement.

> As a language designer, there are more than enough
> issues to resolve, without having to watch your back
> wondering how ASI will interact with new grammar.

Exactly. Multiline comments add extra problems.

> Hope that clears up things a little?
Totally agree with you on this one.
-- 
Garrett
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to