Re:Ask HN: Why use semicolons to terminate statements in mod...
by bdfh42 on Monday November 24, 2008 @03:58AM
(#374600)
Explicit statement termination is all about speed - ensuring that JavaScript interpretation is as rapid as possible. Terminating a statement implicitly requires additional processor cycles - and we still need to husband those cycles to maintain a responsive user experience.
[ Parent
| on HN ]
Re:Ask HN: Why use semicolons to terminate statements in mod...
by timknauf on Monday November 24, 2008 @05:04AM
(#374643)
Hmm, interesting point. I've never worked on a truly large JavaScript codebase; it would be interesting to test the effect of implicit and explicit termination on various JavaScript engines. Presumably the performance penalty would apply to traditional interpreter-style engines much more than to modern compiling engines like V8.
Re:Ask HN: Why use semicolons to terminate statements in mod...
by cabalamat on Monday November 24, 2008 @05:36AM
(#374660)
Explicit statement termination is all about speed - ensuring that JavaScript interpretation is as rapid as possible.
Is this correct? I would imagine that JavaScript implementations typically compile it into intermediate code, wihch is then interpreted. If so, then it shouldn't make any difference whether you add the semicolon or not.