Ask HW: What is the state (for you) of CoffeeScript? - usernamebias
======
uwu
> for you

a project i know uses coffeescript and i see it as an additional hoop for
possible contributors who otherwise know the web platform to jump through

(i contributed to that project once and accidentally introduced a bug related
to variable scoping...)

i think nowadays people should be writing es6+ javascript instead (won't even
need to transpile it in the future)

------
twobyfour
Irrelevant. Never needed it, never wanted it. And I develop for web (full
stack).

------
rraval
For background, my startup has been using CoffeeScript since August 2012. A
quick check of our git monorepo says that we have 130k lines of code at HEAD,
and have probably thrown out at least as many lines in rewrites over the
years.

I have a love/hate relationship with CoffeeScript. I detest the implicit
function call and object literal syntax. At various points in the language's
history, it seemed like the language was essentially "done" and in maintenance
mode. Especially when the eco-system stagnates around it and large parts of
the community move on to things like ES6 and TypeScript. For example, the JSX
tool was essentially a prototype [1], with tons of bugs [2] that were never
fixed. And in the 6 months since its deprecation, there isn't a single tool to
replace it.

Personally speaking, I consider the language dead and was considering
alternatives so we could move off it. However, I still haven't been able to
justify it because the alternatives don't make the same tradeoffs that make me
love CoffeeScript:

\- Minimal to zero runtime requirements. CoffeeScript generates a few things
like `__extends` but that's it!

\- One to one correspondence with generated JS. Source maps are nice but it's
great to step through the JS debugger when looking at JS, and being able to
convert the JS you're looking at with the CoffeeScript that generated it is
not something I want to give up.

\- Recognizes the warts, fixes what it can, and then gets the hell out of the
way. `==` in JS is a mistake and IMO no language should carry that forward.
Lexical `this` binding shouldn't require hoops to jump through. That sort of
thing.

Ideally, if we are paying the cost of switching away from CoffeeScript, we'd
move to a language with static type checking and solid support for sum types.
I haven't been able to find any such language though, and the recent
development spurt in CoffeeScript seems to have staved off that need for now.

PS: Yes, I'm aware of TypeScript. It's sum type support is rather weak. As
part of my initial testing to see if it was a suitable language, I found a 5
line program that crashed at runtime. The bug report was closed as "Working as
intended" [3]

[1] [https://github.com/jsdf/coffee-react-
transform](https://github.com/jsdf/coffee-react-transform) [2]
[https://github.com/jsdf/coffee-react-
transform/issues/62](https://github.com/jsdf/coffee-react-transform/issues/62)
[3]
[https://github.com/Microsoft/TypeScript/issues/13884](https://github.com/Microsoft/TypeScript/issues/13884)

~~~
jdd
The TS response makes sense in light of the other issues your desired behavior
would cause.

