Zolmeister / promiz

A polyfill for ES6-style Promises in 913 bytes (gzip)
MIT License
102 stars 11 forks source link

Add semicolons to the code? #8

Closed dandv closed 9 years ago

dandv commented 9 years ago

Thanks for writing Promiz. I found the code beautiful and a great resourced for teaching certain aspects of advanced JavaScript.

The lack of semicolons though detracts from its value. Any chance to add them?

Zolmeister commented 9 years ago

tl;dr ASI is a feature of the language, and I find code to be more readable without semicolons.

dandv commented 9 years ago

Will any amount of showcases where the lack of semicolons bites back, hard, convince you?

Zolmeister commented 9 years ago

No. I find most examples are contrived, and stem from a lack of information about how ASI works. The increase in readability that comes from not writing semicolons is far too valuable.

weakish commented 9 years ago

@dandv Just be careful when a line begins with [(/+- -- and /+- rarely appear in the beginning of line, so mostly just [( -- to avoid "Lack of semicolons bites back".

dandv commented 9 years ago

@weakish, also {:

function foo() {
    var bar = 5

    return
    {
        bar: bar
    }  // surprise
}