Live data from Hacker News

CoffeeScript 1.7.0

coffeescript.org

51–60 of 91 posts

Re: CoffeeScript 1.7.0

#51
post #5

Earlier quoted context omitted.

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.

There has been a development of hate towards CoffeeScript in most JavaScript communities. This is FUD. CoffeeScript is JavaScript, and if you come into CoffeeScript thinking it works like ruby just because it looks like ruby then you're in for a rude awakening. Personally, I'm a fan of CoffeeScript's streamlined syntax compared to JavaScript. For example: describe 'when the universe exists', -> it 'should be active',…

And moreover,

    describe 'syntax after upgrading', ->
      it 'should be even meatier', ->
        expect parentheses.required
          .toBe false
Very tidy.

Re: CoffeeScript 1.7.0

#54
post #50

I love the paren-free chaining but >When requiring CoffeeScript files in Node you must now explicitly register the compiler. This can be done with require 'coffee-script/register' or CoffeeScript.register(). Also for configuration such as Mocha's, use coffee-script/register. Since I have not been specifying my CoffeeScript version, I have a feeling this update is going to break a lot of my Node.js code. Am I right?

If you are running your code via 'coffee' or if you are compiling your code to JS this won't affect you.

Re: CoffeeScript 1.7.0

#55
post #25
post #5

Earlier quoted context omitted.

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.

Like the Node.js community, when they're not busy fighting themselves over gender pronouns.

Ooh, is there a story behind this one?

Re: CoffeeScript 1.7.0

#56
post #53

Let's all take a moment to reflect on the elegance of the grammar.coffee file [0]. Notice how the function named 'o' provides simplicity as it plays well paren-less function calls. [0] - https://github.com/jashkenas/coffee-script/blob/master/src/g...

Wow that is insanely beautiful to my eyes — thanks for pointing this out! Only thing that might make it better would be a litcoffee version :)

Re: CoffeeScript 1.7.0

#57
post #56
post #53

Let's all take a moment to reflect on the elegance of the grammar.coffee file [0]. Notice how the function named 'o' provides simplicity as it plays well paren-less function calls. [0] - https://github.com/jashkenas/coffee-script/blob/master/src/g...

Wow that is insanely beautiful to my eyes — thanks for pointing this out! Only thing that might make it better would be a litcoffee version :)

Thanks for pointing out litcoffee.

Re: CoffeeScript 1.7.0

#58
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 also included by default in Play Framework.

I used it for a while, on a large project, and eventually came to hate it. I try to write as clean code as ppossible but still found the resulting mess of words, commas and arrows floating around at differing indentation levels to be much harder to read.

To me, even though javascripts syntax can be annoying, it's parentheses provide a certain amount of structure to the code.

Re: CoffeeScript 1.7.0

#59
What does %% do? The documentation says: a %% b is the same as (a % b + b) % b, but what is the difference between "true mathematical modulo" and the standard modulo?

Re: CoffeeScript 1.7.0

#60

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…

...it also seems to compile a bit faster. for my project...

  1.6.3  real    0m2.287s
  1.7.0  real    0m1.655s
Post reply on HN