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?
CoffeeScript 1.7.0
61–70 of 91 posts
Re: CoffeeScript 1.7.0
#62Earlier 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.
Ultimately though, wouldn't you want to use a js preprocessor that lets you write full spec ES6 and compiles down to ES4 or whatever your runtime target is? That's available today, and it doesn't confuse the meaning of class, fat arrow, variable scoping, etc.
Re: CoffeeScript 1.7.0
#63Let'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...
Re: CoffeeScript 1.7.0
#64What 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?
I guess: -2 % 6 = -2, but -2 %% 6 = 4.
Re: CoffeeScript 1.7.0
#65Earlier 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.
Ruby: _why hates you, and you're all just ghetto anyway
Nodejs: he and she are bad words.
Re: CoffeeScript 1.7.0
#66Is coffeescript still hip? I used to read a lot about it on here, maybe a year or two. Where is it at? Mainstream?
http://www.google.ca/trends/explore?q=coffescript#q=coffescr...
Re: CoffeeScript 1.7.0
#67Is coffeescript still hip? I used to read a lot about it on here, maybe a year or two. Where is it at? Mainstream?
I'm a former diehard JavaScript guy who uses CoffeeScript pretty much exclusively now.
Re: CoffeeScript 1.7.0
#68Is 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
#69 api.get 'comments/1'
.then transformComment
.then (comment) ->
appendwithEvents comment, 'click'
cacheComment comment
.fail console.errorRe: CoffeeScript 1.7.0
#70Earlier quoted context omitted.
(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.
arr = [1, 2, 3]
[..., two, three] = arr
or look for node-style callbacks... myFun = (..., cb) ->
cb()
But you can't use it multiple times. That would allow for ambiguous syntax: # disallowed
[..., whatAmI, ...] = [1, 2, 3, 4]
[0] https://gist.github.com/aseemk/8637896#expansion-in-array-de...