|
|
|
|
|
by exyi
1475 days ago
|
|
You can't disable this "feature", so you still don't know where things end / begin. Some tags can't be nested in <p> while you could expect that they can: <p>
Paragraph with a list won't work as you could think
<ul> <li> Test </li> </ul>
Something else
</p>
Parses to: <p>
Paragraph with a list won't work as you could think
</p>
<ul> <li> Test </li> </ul>
Something else
<p></p>
Similarly, in JS you are paying the price for optional semicolons even if you decide to use them. return
{
x: 1
};
Will still not work even if you use semicolons elsewhere. So I don't see any advantage to actually using semicolons. JS is not worse than Python with it's basic inference, and yet in Python people will almost yell at you if you attempt to use a semicolon :)I'd much prefer these features to be opt-in (yea, give me XHTML back for generated content). But when I can't can't disable them, why not embrace them ;) |
|
JS semicolon insertion is worse, because it depends on the following line. In Python, an unescaped newline outside of brackets always ends the statement, but in JavaScript, parentheses, brackets, binary operators, and template literals on the following line change that. The Python rule also makes a dangling operator outside of brackets a syntax error, which is a potential source of unintentional introduction of ASI when making changes to code in JavaScript.