News for hackers. Stuff that matters.
Re:The Great CoffeeScript to Typescript Migration of 2017 by crazygringo on Friday May 15, 2020 @07:08PM (#23198572)
The article literally provides you with the answers, from a front-end developer survey:

  Lack of delimiters
  Overly opinionated syntactic sugar
  Lack of community support for the language
  Hard to read because of dense syntax
  Prone to errors because of syntactic ambiguities
For me personally it was the last one. The actual parsing/interpretation behavior is undocumented beyond a handful of basic principles, and chock-full of edge-case ambiguities. Running into undocumented/unpredictable behavior literally daily in a language for me was a deal-breaker.
Re:The Great CoffeeScript to Typescript Migration of 2017 by canada_dry on Friday May 15, 2020 @07:29PM (#23198719)
> chock-full of edge-case ambiguities

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.

Re:The Great CoffeeScript to Typescript Migration of 2017 by RcouF1uZ4gsC on Friday May 15, 2020 @08:13PM (#23199058)
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.
Re:The Great CoffeeScript to Typescript Migration of 2017 by hn_throwaway_99 on Friday May 15, 2020 @08:17PM (#23199092)
> 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.

Re:The Great CoffeeScript to Typescript Migration of 2017 by ygra on Saturday May 16, 2020 @04:42AM (#23201627)
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.
Re:The Great CoffeeScript to Typescript Migration of 2017 by unethical_ban on Friday May 15, 2020 @08:31PM (#23199199)
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.
Re:The Great CoffeeScript to Typescript Migration of 2017 by eevilspock on Friday May 15, 2020 @07:57PM (#23198957)
You can skip semicolons in Javascript and Typescript in all but the rare cases where there is ambiguity. That's what I do and there is zero problem.
Re:The Great CoffeeScript to Typescript Migration of 2017 by adamredwoods on Friday May 15, 2020 @08:22PM (#23199116)
Am I correct in stating that standard Typescript no longer requires semi-colons?
Re:The Great CoffeeScript to Typescript Migration of 2017 by Sebb767 on Friday May 15, 2020 @08:30PM (#23199181)
Yes. This has been the case for at least two years now.
Re:The Great CoffeeScript to Typescript Migration of 2017 by _630w on Saturday May 16, 2020 @01:06AM (#23200636)
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.
Re:The Great CoffeeScript to Typescript Migration of 2017 by feross on Saturday May 16, 2020 @02:44AM (#23201031)
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/

Re:The Great CoffeeScript to Typescript Migration of 2017 by CuriousSkeptic on Saturday May 16, 2020 @08:28AM (#23202853)
There is no ASI in “strict mode”. And modules are always in strict mode.

Edit: I was mistaken about strict mode.

Re:The Great CoffeeScript to Typescript Migration of 2017 by pygy_ on Saturday May 16, 2020 @08:37AM (#23202903)
That is just not true. You can write semi-less JS modules, strict mode and ASI are orthogonal.
Re:The Great CoffeeScript to Typescript Migration of 2017 by CuriousSkeptic on Saturday May 16, 2020 @10:23AM (#23203595)
Indeed, just read the spec: https://tc39.es/ecma262/#sec-automatic-semicolon-insertion

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.

Re:The Great CoffeeScript to Typescript Migration of 2017 by searchableguy on Saturday May 16, 2020 @04:20AM (#23201471)
Thanks for the link!
Re:The Great CoffeeScript to Typescript Migration of 2017 by realharo on Saturday May 16, 2020 @03:48AM (#23201314)
Can you show an example of such a bug? The only thing I can think of is

    return
        value
which will get flagged by TS as unreachable code (you can try it in https://www.typescriptlang.org/play)
Re:The Great CoffeeScript to Typescript Migration of 2017 by searchableguy on Saturday May 16, 2020 @04:12AM (#23201433)
I can't think of a good real world example atm but

Say, you have

    let a = 1
    let b = 2
    (a + b) <--- b won't be 
    accessible here. 
This will also get flagged by ts. But not everyone uses ts. /shrugs

Feross is right, I guess.

Re:The Great CoffeeScript to Typescript Migration of 2017 by realharo on Saturday May 16, 2020 @04:14AM (#23201442)
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).
Re:The Great CoffeeScript to Typescript Migration of 2017 by osdiab on Saturday May 16, 2020 @05:00AM (#23201729)
I just use ESLint + auto fix on save and I've never had to worry about semicolons for years, and even if i did it's not an error in JS.