That is an issue... though I really, really love python because of it's lack of delimiters. It annoys me to no end switching from python to java, jscript, c#, etc. and forgetting a semi-colon or having a comma at the end of a list trigger a compile error.
I am the opposite. I hate python’s lack of delimiters. You move a block of code around when refactoring and suddenly what is part of an if or while is not longer part of an of or a while because the editor screwed up spacing. I would much rather have to deal with a compiler error telling me I need a brace, than a runtime error because code is unconditionally run when it was supposed to be a part of an if statement.
> forgetting a semi-colon or having a comma at the end of a list trigger a compile error.
I mean, these days though, I rarely have "compile errors". Meaning in-editor compiling is so good that any "red squigglies" get immediately fixed. Writing TypeScript in VSCode I can barely remember last time my actual compile step failed.
Well, that's basically because these days the editor often runs the same compiler, just without codegen instead of having a completely separate syntax checker that may or may not highlight the same issues.
Funny, I think Python's whitespace delimiters is one of the saddest design decisions it made. I know why it was made, and linting wasn't a think back in the day, but being able to properly reformat code with machines / compress code is so much easier with real delimiters.
But don't please. Semicolons are not optional. When you don't put your semicolons, they will inserted by the parser and it can introduce some buggy code especially if you are using some formatter.
The behavior of ASI is fully specified. Semicolons are optional. There is no undefined behavior in the language spec that makes using semicolons somehow safer.
Furthermore, even if you always write semicolons you are still subject to ASI modifying your code by inserting additional semicolons where you don’t want them. So you need to learn the rules of ASI regardless of whether you use semicolons or not. https://feross.org/never-use-semicolons/
No mention of strict mode in the section of ASI. Could have sworn that the ASI issues I’ve ran into in the past was resolved by using strict mode, not sure what I’ve got that from.
I think eslint would flag it as well for what it's worth (https://eslint.org/demo, you have to set it to newer ES version in the Rules configuration at the bottom of the page).
That is an issue... though I really, really love python because of it's lack of delimiters. It annoys me to no end switching from python to java, jscript, c#, etc. and forgetting a semi-colon or having a comma at the end of a list trigger a compile error.