Live data from Hacker News

Decaffeinating a Large CoffeeScript Codebase Without Losing Sleep

eng.datafox.com

41–47 of 47 posts

Re: Decaffeinating a Large CoffeeScript Codebase Without Losing Sleep

#41

This article is missing one important thing: CoffeeScript now supports native import and export statements, but decaffeinate doesn't. I recently migrated several large codebases and had to escape all the import and export statements (which wasn't very hard), but it got a little hairy where we were directly exporting instead of assigning it to a variable first. I'm going to miss CoffeeScript, but being able to use ES7…

CoffeeScript 2.0beta has async/await and it works great.

Re: Decaffeinating a Large CoffeeScript Codebase Without Losing Sleep

#42
post #12

It's pretty wild having seen CoffeeScript spread like a wildfire in the early 2010s, only to be discarded nearly as fast a couple years later.

Same, the JS cool-kids swore up-and-down that CoffeeScript was the future and we'd be fools to not jump on. It's another reminder that no-one knows the future.

It was the future… so many CoffeeScript niceties (spread operators, destructured assignment, class syntax, ARROW FUNCTIONS) were subsequently mainlined into ES6.

Re: Decaffeinating a Large CoffeeScript Codebase Without Losing Sleep

#43
post #3

Plain vanilla JS (and therefore TypeScript) still lacks one killer feature from the Coffee family: Null propagation operators (`a ? b` => `a != null ? a : b`, `a?.x` => `a == null ? null : a.x`, etc). Even C# has it.

The other killer feature that is still missing is multi-line regex with inline comments. I know, you shouldn't be writing big regexes if possible… but when you need to, it's so nice to be able to actually explain what the heck you are doing!

Re: Decaffeinating a Large CoffeeScript Codebase Without Losing Sleep

#44
post #12

Earlier quoted context omitted.

Same, the JS cool-kids swore up-and-down that CoffeeScript was the future and we'd be fools to not jump on. It's another reminder that no-one knows the future.

CoffeeScript always felt forced onto me during the height of 37Signal's influence of software development trends at the time. At the only rails shop I ever worked at it was heavily resisted. It was at the same time I was reading more and more of Resig blogs and books (Secrets of the JavaScript ninja) and I really began to learn and grok just plain normal JavaScript. I said to myself, "you know, this really isn't that…

What do you dislike about ES' direction? The increase in language features in general, or more specific things?

Re: Decaffeinating a Large CoffeeScript Codebase Without Losing Sleep

#45
post #15

It's pretty wild having seen CoffeeScript spread like a wildfire in the early 2010s, only to be discarded nearly as fast a couple years later.

I can relate. I wrote an essay on this a while back: https://www.nemil.com/musings/shinyandnew.html Excerpt: Pity the modern web or mobile app developer on Hacker News. As a full stack startup developer in 2012, you were building websites using Ruby/Rails on the backend, Backbone/Coffeescript/Underscore on the frontend, while deploying your app with Capistrano (or the relevant Python analog). By 2013, you'd transitio…

I'm not sure HN headlines - even ones like "we rewrote our codebase with X" - indicate that people are actually rotating libraries quickly. Rather, they indicate our quickly-shifting curiosity, and cherry-pick instances of people actually acting on it because they're interesting. Tellingly, the "rewrite" blog posts usually are coming not from the fad preceding the current, but something much older.

Re: Decaffeinating a Large CoffeeScript Codebase Without Losing Sleep

#46
post #36
post #14

Earlier quoted context omitted.

You can write CoffeeScript to target Node...

The question is, why? Realistically, everybody who uses Coffeescript is/was a Rails developer at some point since the syntax is very opinionated towards rubyists. The typical Node dev is more likely to use ES6/7 which fixes a lot of the same js issues as Coffeescript.

As far as I can tell, much of the ES6 changes came from people who were using CoffeeScript before.

Re: Decaffeinating a Large CoffeeScript Codebase Without Losing Sleep

#47
post #44

Earlier quoted context omitted.

CoffeeScript always felt forced onto me during the height of 37Signal's influence of software development trends at the time. At the only rails shop I ever worked at it was heavily resisted. It was at the same time I was reading more and more of Resig blogs and books (Secrets of the JavaScript ninja) and I really began to learn and grok just plain normal JavaScript. I said to myself, "you know, this really isn't that…

What do you dislike about ES' direction? The increase in language features in general, or more specific things?

Increase in features yes and the continual succumbing to developers who just can't seem to think outside the strict OO paradigm.

Prototypical inheritance is really not that hard to understand.

I would rather see JavaScript fix the existing functionality, such as sometimes the prototype chain not being correctly established when instantiating a new object.

Post reply on HN