4 ms·
> A language that uses archaic syntax with dollar vars, semicolons, is pretty verbose itself may die Careful there :-) Modern javascript has semicolons and is
by azangru 5y ago
> A language that uses archaic syntax with dollar vars, semicolons, is pretty verbose itself may die
Careful there :-) Modern javascript has semicolons and is introducing pretty horrendous syntax for private variables (an octothorpe) and possibly for the pipe operator (percent sign, was it?) and for tuples and records, yet is showing no signs of dying.
- cute_boi 5y agoI have never written JS with semicolons after 2015 idk why you are saying Modern JS has semicolons? I simply didn't get it. Am I missing something.
- azangru 5y agoI mean, it clearly has them; it's part of the syntax. You can skip them, and the parser will insert them for you; but the language has them.
- cute_boi 5y agoyea but its optional so does it matter? In PHP its compulsory, right?
- Minor49er 5y agoSometimes the extra options can produce unexpected problems. For example, in JavaScript, this would return nothing and may result in an unreachable code warning: function go() { return 5 + 3; } console.log(go()) Since semicolons are optional, it's treating "return" as its own statement and "5 + 3" as a separate one. There are no hidden gotchas like this in PHP though since semicolons are always used: function go() { return 5 + 3; } var_dump(go()); This will return int(8).