Live data from Hacker News

CoffeeScript 1.7.0

coffeescript.org

31–40 of 91 posts

Re: CoffeeScript 1.7.0

#31

// for integer division instead of comments? Are these guys on crack?

Its not unheard of. There's another niche language called "Python" that does exactly the same thing. Comments are `#`, as anyone using a unix shell would expect.

Re: CoffeeScript 1.7.0

#33
post #26

I absolutely love CoffeeScript, with how it structures classes and functions makes sense (plus the python like syntax was a big plus for work). JavaScript seemed to unorganized, unclear, and cluttered for big projects.

I do a fair amount of coffeescript work and every time I see the compiled source I'm so glad that I'm writing in coffeescript. It's not just that it makes certain JS gotchas almost non-issues (almost! there are still several things that can trip you up), it's that it makes clean, concise and correct programming so much easier. There are a lot of things, like curried functions (`f = (a) -> (b) -> result`) or testing for membership in a list (`if foo in [a, b, c]`) which one is much more likely to use in coffeescript than JavaScript because the syntax is so much nicer. Having good syntax doesn't just make it easier to read and write, it promotes good habits and discourages bad ones.

Re: CoffeeScript 1.7.0

#34
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.

A doom dependent on full adoption of ES6 could easily be a decade out, to be fair. There aren't, as far as I know, any browsers that expose ES6 without non-standard compile/runtime flags, and we have to wait until there's enough adoption that the % of people using pre-ES6 browsers is negligible.

Hell, I'm still waiting for Array::map to be dependable.

Re: CoffeeScript 1.7.0

#35
post #5
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?

There has been a development of hate towards CoffeeScript in most JavaScript communities. CoffeeScript seems to be very popular in the non-JS communities that need to write JavaScript, like in the Ruby and Python web development communities. CoffeeScript was designed for non-JS coders to feel a lot more comfortable writing JS.

I don't mind what it does to improve the class model, but I dislike how it breaks certain C idioms. It's very awkward to write an expressive loop, for example.

Re: CoffeeScript 1.7.0

#36
post #8

Earlier quoted context omitted.

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.

A doom dependent on full adoption of ES6 could easily be a decade out, to be fair. There aren't, as far as I know, any browsers that expose ES6 without non-standard compile/runtime flags, and we have to wait until there's enough adoption that the % of people using pre-ES6 browsers is negligible. Hell, I'm still waiting for Array::map to be dependable.

Hell, I'm still waiting for [1, 2, 3].indexOf(2) to be dependable ;)

Re: CoffeeScript 1.7.0

#39
post #5
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?

There has been a development of hate towards CoffeeScript in most JavaScript communities. CoffeeScript seems to be very popular in the non-JS communities that need to write JavaScript, like in the Ruby and Python web development communities. CoffeeScript was designed for non-JS coders to feel a lot more comfortable writing JS.

I'm also not so sure about the "non-JS coders" part. As a proficient Javascript programmer, I absolutely love CoffeeScript. I even recommand it to learn the good parts of JS when you are completely unfamiliar with it. I think there is a lot more than synctactic sugar to Coffeescript. It makes obscur or verbose JS patterns really easy to use. My code generally compiles down to up to twice as much JS code. Yes the compiler outputs somewhat verbose JS, but I can't deny the speed and ease I've gain with it. And it is only my first professional project using it.

Re: CoffeeScript 1.7.0

#40

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 m…

Nice… I had been using '__', but it seems like this will allow you to use it multiple times in a parameter list.
Post reply on HN