Hacker News new | ask | show | jobs
by axod 5837 days ago
I don't actually remember what closure advanced mode does. It's quite possible it does remove ";" in some instances. But really, you either need a newline or a ";" to mark the end of a statement, so the question is fairly moot - it's gonna be 1 byte either way.

If you always put semicolons to mark the end of a statement, then seeing a statement without one would be like seeing a megablocks brick in your lego box - glaringly obvious and extremely offensive.

IMHO that backeting style sucks, and shouldn't be used, at least in js.

1 comments

If you write one statement per line, the code is very clear, and there is no need for semicolons. It is after all possible, according to the syntax, and a minifier should be able to understand it, as well as your browser.

I am certainly not against coding practices or readability. With (Q)BASIC, you could also add semicolons and have multiple statements per line, but who did ? It seems that it is the same with Javascript, semicolons are separators between statements, as well as newlines : why write both ? just to be sure they are well separated ?

it may be 'clear' to you, but as has been pointed out, it can be ambiguous as to what the code will do. The example with a line starting with an open bracket is one such example.

Why force yourself to remember edge cases, when you can just remove that whole class of bugs by being explicit about what you mean...