The key point: "ASI [“Automatic Semicolon Insertion”] is an error correction procedure. If you start to code as if it were a universal significant-newline rule, you will get into trouble."—Brendan Eich
That doesn't sound right to me. Making s language's syntax more liberal is not a sane way to correct errors. If anything, JavaScript's ASI is an error creation mechanism.
Brendan Eich: The infernal semicolon
11–20 of 143 posts
Re: Brendan Eich: The infernal semicolon
#12Be liberal in what you accept and conservative in what you send (i.e. just use semi-colons) and your systems will work and play well with others being interoperable.
Re: Brendan Eich: The infernal semicolon
#13Re: Brendan Eich: The infernal semicolon
#14Earlier quoted context omitted.
That doesn't sound right to me. Making s language's syntax more liberal is not a sane way to correct errors. If anything, JavaScript's ASI is an error creation mechanism.
"Here is your new apartment. You must use a key to enter it. If you forget your key, you can buzz the superintendent during business hours, and if the super is home, (s)he will open the door for you.” If you try to take your key with you at all times, the super will save your bacon once in a blue moon when you forget your key. On the other hand, if you think of the door as only needing a key when you wish to have it…
Re: Brendan Eich: The infernal semicolon
#15Re: Brendan Eich: The infernal semicolon
#16I can't believe that I woke up this morning and more semicolon arguments are at the top of hackernews..
Re: Brendan Eich: The infernal semicolon
#17Re: Brendan Eich: The infernal semicolon
#18I wish Brendan was not as skilled a hacker as he was. It's an amazing achievement that he produced Javascript in such a short time. Unfortunately it ended up having the sorts of flaws that are inevitable with such a timeframe, yet it was "good enough" so that everyone decided it was easier to live with the flaws than break compatibility and fix them. If the initial version of Javscript had been worse, we might be using a much better version today.