Live data from Hacker News

Announcing CoffeeScript 2

coffeescript.org

11–20 of 220 posts

Re: Announcing CoffeeScript 2

#12
> So a CoffeeScript => is now output as =>

Wait, using the arrow function notation doesn't bind this, arguments, super, or new.target[1] in javascript, as opposed to the normal function syntax. Not being a user of coffeescript, did coffeescript not do that already, or did they also throw in code to change that in the generated code?

It seem to me it would make sense to map items that match conceptually, not just notationally (unless it's common to have both coffeescript and JS side by side). Can someone comment on how this is handled?

1: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...

Edit: Added "in javascript" after reference to make it obvious I was talking about JS behavior for the binding.

Re: Announcing CoffeeScript 2

#13
I don't know what to think about coffeescript anymore. I love it back then before babel and ES6, but right know I didn't even know how to use coffee and a library used today. Still miss the python/ruby-sque sintaxt witouth brackets.

Edit: After reading more about the changes about CS 2.0, I may give it one more chance, let's see how it work now.

Re: Announcing CoffeeScript 2

#14
Jeremy,

First off thank you for Underscore, Backbone and CoffeeScript. Your work really has helped me and my development team.

This question is a little off topic but one I've been wanting to ask for a long time:

Last year you took a year off from The New York Times to ride your motorcycle across the Western Hemisphere. Just recently you were hired back at the paper, doing what it appears to be the same thing in the graphics department.

From a hiring perspective, did you have to reapply for your job, or did the Times just give you the necessary time off?

If this was considered a "sabbatical," how did you justify traveling around the Americas as something that could benefit the paper?

I don't mean to offend. I'm genuinely curious. A lot of people aren't fortunate enough to take a year off for traveling and then be rehired at their company, especially in the journalism industry with the revenue declines, job cuts and managers wanting to hire cheaper people.

Thanks again for all you've contributed.

Re: Announcing CoffeeScript 2

#15
post #12

> So a CoffeeScript => is now output as => Wait, using the arrow function notation doesn't bind this , arguments , super , or new.target [1] in javascript, as opposed to the normal function syntax. Not being a user of coffeescript, did coffeescript not do that already, or did they also throw in code to change that in the generated code? It seem to me it would make sense to map items that match conceptually, not just…

CoffeeScript did already bound `this` for `=>`. There is also `->`, which is morally equivalent to JS' old-style `function`.

Re: Announcing CoffeeScript 2

#16
Congrats!

I loved the elegance coffeescript & it was the language that convinced me JS was a reasonable target.

Though I, like many, moved to TS, I use CS every day via its spiritual child es6.

Re: Announcing CoffeeScript 2

#17
post #10

I can't imagine CoffeeScript will see much adoption these days as most people seem to think ES6+ is "good enough". I miss how concise functions are in CoffeeScript and also miss being able to do object literals without the braces. But there's no chance at all in convincing my team to adopt it, as modern JS really is "good enough".

And that's totally fine! I don't get a chance to use it much these days either.

But for the folks who still do — or have existing codebases — this update is for you.

Re: Announcing CoffeeScript 2

#18
While I understand the let vs var thing, I wish I could tell the compiler that I promise not to non-obviously reference a local var (e.g. in an eval). Then CoffeeScript could determine it is only written at decl time and could use const. Technically, this could be used for var scoping too in the let vs var issue.

> Keep in mind that const only protects you from reassigning a variable

While I haven't looked, I'd suspect there are performance implications too.

Re: Announcing CoffeeScript 2

#19

Jeremy, First off thank you for Underscore, Backbone and CoffeeScript. Your work really has helped me and my development team. This question is a little off topic but one I've been wanting to ask for a long time: Last year you took a year off from The New York Times to ride your motorcycle across the Western Hemisphere. Just recently you were hired back at the paper, doing what it appears to be the same thing in the…

I can't answer for him. but it would seem to me that there is a pretty universal shortage of quality developers, much less superstar developers familiar with your existing codebase. Rehiring him would be a no-brainer.

Re: Announcing CoffeeScript 2

#20
post #10

I can't imagine CoffeeScript will see much adoption these days as most people seem to think ES6+ is "good enough". I miss how concise functions are in CoffeeScript and also miss being able to do object literals without the braces. But there's no chance at all in convincing my team to adopt it, as modern JS really is "good enough".

I was browsing the CoffeeScript docs and everything looks much more concise. It seems like your code would half the size. Have people done real world comparisons on large code bases? Rewrites?
Post reply on HN