Live data from Hacker News

Brendan Eich: The infernal semicolon

brendaneich.com

21–30 of 143 posts

Re: Brendan Eich: The infernal semicolon

#21

Moar downvotes! Can we reconsider using this thing as the assembler for the web? Can we come up with a sane, cross-platform bytecode standard?

Indeed, it is a fatal flaw when a language is unable to handle syntax that doesn't correspond to its defined grammar.

Re: Brendan Eich: The infernal semicolon

#22
post #17
post #10

Earlier quoted context omitted.

Feel free to come up with a sane, cross-platform bytecode standard if it sounds doable to you. It doesn't to me.

Why not?

http://news.ycombinator.com/item?id=1893686

Mentioned in http://www.aminutewithbrendan.com/pages/20101122.

JS is becoming the compiler target "bytecode", without needing verifiers or new and complex standards to be adopted by multiple browser vendors.

JS has gaps as a target language, for sure. We are working on filling them (e.g. 64-bit and other int types).

These are easy bugs to fix compared to creating a new, portable, and future-friendly bytecode standard in addition to keeping up with a competitive JS engine. Since JS is incumbent, it's hard for any browser vendor to justify a new thing with zero users at first, and too much risk of non-standardization or JVML-like albatross status.

Re: Brendan Eich: The infernal semicolon

#23

The eternal fires of high level bike shedding: semi-colons, whitespace and curly braces, no programming discussion or language can escape all three. Be 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.

But Postel's law doesn't really help: http://www.joelonsoftware.com/items/2008/03/17.html

Re: Brendan Eich: The infernal semicolon

#24
post #14

Earlier quoted context omitted.

"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…

That's a great analogy.

The difference is that if you forget your key, you know that you forgot your key, and you have to actively call the superintendent to have them "save your bacon." With ASI, you might never know that you had forgotten your key.

Re: Brendan Eich: The infernal semicolon

#26
post #16

I can't believe that I woke up this morning and more semicolon arguments are at the top of hackernews..

You haven't been around for long enough or just aren'y cynical enough, I went to bed knowing that there would be at least 5 more posts about it in the morning

Yeah, standard procedure is

    1. "X is stupid" post
    2. "But I like X" posts

Re: Brendan Eich: The infernal semicolon

#27
post #7

Earlier 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…

Of course other buildings simply don't let you leave without your key, but here at the JS Arms we feel that would be way too complicated.

Re: Brendan Eich: The infernal semicolon

#28

I wish I had made newlines more significant in JS back in those ten days in May, 1995. I 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 compatib…

If javascript were any worse, it may have been sidelined entirely before it had a chance to improve, and we would be using proprietary application stacks like iOS even more heavily for client side development.

Re: Brendan Eich: The infernal semicolon

#29
post #16

I can't believe that I woke up this morning and more semicolon arguments are at the top of hackernews..

You haven't been around for long enough or just aren'y cynical enough, I went to bed knowing that there would be at least 5 more posts about it in the morning

If it's anything like the "Email is dead" one, we've got some more coming. We need at least two arguing for Crockford (one with a liberal amount of "hipster" name-calling), someone arguing for @fat, and @fat eventually explaining himself (because it would be a cold day at Oracle before Doug Crockford said anything other than "you suck").

Re: Brendan Eich: The infernal semicolon

#30
post #20

Just because you can doesn't mean you should. A majority of the JS code out has semicolons. Key individuals on the committee responsible for furthering the development of the language recommend always using it. Not including semicolons has shown to result in code errors. It can also introduce build errors when your code is minified. It can also create mental overhead when other developers try to read your code. I jus…

I suspect it is a matter of background, as you imply. Twitter has its roots in Rails, and I believe they also use Scala heavily. Both Ruby and Scala use newline as a statement terminator. GitHub is another Rails shop that avoids semicolons in JS. Zepto.js recently removed the semicolons from its code base, and its author was a core Rails developer.
Post reply on HN