News for hackers. Stuff that matters.
Re:Doug Crockford Talk on JavaScript by wvenable on Monday November 02, 2009 @08:58PM (#918405)
A language has to be designed around optional line terminators -- you just can't take a language like JavaScript or C and remove the semicolons, they convey meaning to the program. Something like Scala doesn't have the ambiguity that a C or JavaScript program has without line terminators.

So semicolon insertion is just a hack that happens before parsing. It's not that the semicolons are optional, they aren't, but it puts them in automatically according to a set of rules. Unfortunately that means you can't just put a return on a line by itself -- a semicolon will always be inserted.

There are no comments on this comment yet.