News for hackers. Stuff that matters.
Re:Ask HN: Why use semicolons to terminate statements in mod... by halo on Monday November 24, 2008 @06:04AM (#374682)
JavaScript syntax lets you write statements over multiple lines - if the first line cannot be parsed correctly it assumes you meant to continue over to the second line. This leads to odd error messages and JavaScript being harder to debug without semicolons.

Note that this is different to, say, Python, where newline explicitly indicates termination of a statement.

Re:Ask HN: Why use semicolons to terminate statements in mod... by timknauf on Monday November 24, 2008 @06:28AM (#374698)
Well, Python will let certain statements continue over multiple lines as well, e.g.

  someFunction(parameterOne,
               parameterTwo)
I think maybe the difference is that Python has always treated newlines the way it does now. JavaScript, on the other hand, has developed idioms based on the semicolon model. So has the rug has been snatched out from underneith its users by suddenly making them optional? Does the change make a lot of useful idioms harder to implement?