Live data from Hacker News

CoffeeScript 1.7.0

coffeescript.org

11–20 of 91 posts

Re: CoffeeScript 1.7.0

#11
post #3

Is coffeescript still hip? I used to read a lot about it on here, maybe a year or two. Where is it at? Mainstream?

It's been around since 2009, which makes it positively ancient, as far as popular compile-to-JS languages go. But mostly, it's more or less "finished". There are some small new features that will come down the pipe (support for 'yield' and other new ES6+ features, continually improving source maps, and so on), but all of the big bones of the language are done at this point. So no news is good news.

Re: CoffeeScript 1.7.0

#12
post #3

Is coffeescript still hip? I used to read a lot about it on here, maybe a year or two. Where is it at? Mainstream?

I never really bought the "javascript syntax is good enough" argument against Coffeescript. The whole point is that CoffeeScript's defaults encourage good parts JS rather than the bad parts that JS's original syntax encourages.

Hip? Dunno, I moved onto ClojureScript years ago. ;)

Re: CoffeeScript 1.7.0

#13
post #8
post #3

Is coffeescript still hip? I used to read a lot about it on here, maybe a year or two. Where is it at? Mainstream?

CoffeeScript played an important role in the development of ES6, but looking forward, it seems to have a same-but-different set of features vs. actual JavaScript, which may doom its future.

JavaScript will never adopt CoffeeScript syntax and will retain quirks for backwards compatibility (such as the == operator). CoffeeScript may very well settle on features, but only JavaScript's death could doom it - and that seems unlikely.

Re: CoffeeScript 1.7.0

#14
post #3

Is coffeescript still hip? I used to read a lot about it on here, maybe a year or two. Where is it at? Mainstream?

Considering companies like Dropbox and GitHub use it (even outright recommend it), I'd say it's pretty mainstream.

As well as Palantir.

Re: CoffeeScript 1.7.0

#15
post #3

Is coffeescript still hip? I used to read a lot about it on here, maybe a year or two. Where is it at? Mainstream?

I think it counts as mainstream. We've basically migrated entirely off Javascript at Narrative Science, we've got a whole bunch of server- and client-side CoffeeScript. It and Python are our two first-class languages.

Re: CoffeeScript 1.7.0

#16
post #3

Is coffeescript still hip? I used to read a lot about it on here, maybe a year or two. Where is it at? Mainstream?

I don't know if it's "hip," but I think it has a well-established place in the web development ecosystem, especially since using it is one of the defaults in Rails.

Personally, I enjoy it and have been using it to build a fairly large Angular application (Java backend, oddly enough.) I've found that Coffee and Angular complement each other nicely.

Re: CoffeeScript 1.7.0

#17
> Leading . now closes all open calls, allowing for simpler chaining syntax.

I feel like this is an important improvement, but I don't really understand what it means. Can someone elaborate on what this means and how it works? How did things used to be different?

Re: CoffeeScript 1.7.0

#18
post #17

> Leading . now closes all open calls, allowing for simpler chaining syntax. I feel like this is an important improvement, but I don't really understand what it means. Can someone elaborate on what this means and how it works? How did things used to be different?

  result = range 1, 3
    .concat range 4, 6
    .map (x) -> x * x
    .filter (x) -> x % 2 is 0
For example, the leading `.map` closes the open call to `range` and the open call to `concat`. Before 1.7.0, `.map` would be called on the number 6.

Re: CoffeeScript 1.7.0

#19

There's also a nice writeup of some of the more user-visible changes available here: https://gist.github.com/aseemk/8637896

(couldn't edit parent, so)

Top 3 things tl;dr

Paren-free chaining (think jQuery or d3):

    bar = svg.append 'rect'
      .attr 'fill', 'papayawhip'
      .attr 'width', width
      .attr 'height', 0
      .attr 'y', height
      .attr 'data-hover', data.slug
Ellipsis for soaking up matching parameters, even if you don't want to name a variable:

    [first, ..., last] = arrayOfStuff

    lastArgumentFn = (..., last) -> last
... and generally improved source maps.

Re: CoffeeScript 1.7.0

#20
post #17

> Leading . now closes all open calls, allowing for simpler chaining syntax. I feel like this is an important improvement, but I don't really understand what it means. Can someone elaborate on what this means and how it works? How did things used to be different?

It would have been nice if their code example for this feature showed how the code would have looked in the prior version of Coffeescript.
Post reply on HN