News for hackers. Stuff that matters.
Re:From 200K lines of CoffeeScript to zero: making decaffein... by partycoder on Sunday January 07, 2018 @01:14AM (#16089552)
I found CoffeeScript to be a pain to work with.

CoffeeScript added some useful features, like destructuring assignments, and some syntax sugar for objects, loops, etc... but it also made some choices that in my opinion are bad:

- Making delimiters optional like parentheses, brackets, semicolons... in addition to implicit return statements: makes programs hard to read if abused. Makes code formatters get confused and corrupt your code.

- Not being able to distinguish an assignment from a variable definition: causes identifier typos to become new variables.

This implicitness makes programs error prone in ways that are hard to verify and work with. Plus, needs to be transpiled and you will need sourcemaps.

In the end, the benefits are not worth it, even back during the time it was created.

Re:From 200K lines of CoffeeScript to zero: making decaffein... by DiThi on Sunday January 07, 2018 @10:02AM (#16091049)
The first problem is easily avoided with a few style guidelines. If a feature exists it doesn't mean it must be used. You can configure CoffeeLint to avoid confusing constructs.

The second problem didn't turn out to be as big as I thought. I was bitten by it about a couple times a year, and every time it was symptom of too long functions or too many closure nesting.

Transpiling and source maps are not a problem. Small changes in my code takes 200 ms to recompile with source maps, with webpack in watch mode (projects are ~20k lines). And when I start a new project I just copy the webpack config from the previous one (with cli switches for several features).

Re:From 200K lines of CoffeeScript to zero: making decaffein... by ddebernardy on Sunday January 07, 2018 @01:46AM (#16089649)
Another pain is (was?) debugging. This might have changed since but back when I tried and rejected using it. But back then, if you had an error at line X it would report the (compiled) JavaScript line rather than the CoffeeScript line - meaning you'd need to figure out which CS code generated what line of JS code in order to hunt down and fix issues.
Re:From 200K lines of CoffeeScript to zero: making decaffein... by teh_klev on Sunday January 07, 2018 @02:15AM (#16089723)
Re:From 200K lines of CoffeeScript to zero: making decaffein... by jononor on Sunday January 07, 2018 @07:15AM (#16090578)
Yup sourcemaps works fine for this, at least in browsers
Re:From 200K lines of CoffeeScript to zero: making decaffein... by DiThi on Sunday January 07, 2018 @10:04AM (#16091059)
It works with node --inspect as well.
Re:From 200K lines of CoffeeScript to zero: making decaffein... by partycoder on Sunday January 07, 2018 @09:54PM (#16094324)
Most likely you will like to set a breakpoint at the entrypoint. You can do this with --inspect-brk rather than --inspect.

Then you can see all debugging sessions in Chrome using chrome://inspect