Live data from Hacker News

In Which I Tell You to Stop Whining About CoffeeScript

singy.posterous.com

1–10 of 55 posts

Re: In Which I Tell You to Stop Whining About CoffeeScript

#2
Fully agreed. The syntactic sugar saves lots of time in total, and there are few bonuses like

    for own key, value in hash
that also checks `hash.hasOwnProperty(key)`, which is good practice in JavaScript, but really boring to type in almost all `for` statements.

I also observed that using longer, more descriptive variable and function names, the difference between Coffee and compiled JS is definitely not an issue in debugging sessions. I'd say there is not a context switch even.

It feels like thinking in JavaScript and writing in a new dialect.

Re: In Which I Tell You to Stop Whining About CoffeeScript

#3
I wish I could say blog posts like this helped the cause, but my feeling after reading it is just meh. I'm fanatic about CoffeeScript but there will always be a divide between people who are willing to try it and people who won't. Writing blog posts that effectively regurgitate the documentation while being a bit religiously pushy about it just seem kind of counter to the cause.

Re: In Which I Tell You to Stop Whining About CoffeeScript

#4
> Consider the closure syntax in JavaScript:

Proceeds to list example that isn't valid JavaScript.

I have no fundamental objections with CoffeeScript, but I will never use it because there's nothing wrong with JavaScript that CoffeeScript improves upon.

For me, personally, it's way easier to visually scan a file that looks like this:

var helloWorld = function () {

     // ...
}

Than this:

helloWorld ->

    // ...
It's also easier to grep and sed.

I don't mind if you use CoffeeScript, but don't try and force-feed me some BS about concise syntax, make broad generalizations (complex CoffeeScript is harder to debug than JavaScript), or attack someone as a 'whiner' because they said "It's nice, but not my cup of tea."

My thought process:

1. In order to debug CoffeeScript, I will need to know JavaScript.

2. If I run into a tricky problem, not only will I need to know JavaScript but I'll also need to know the CoffeeScript compiler's internals.

3. If I run into a really tricky problem, or if I need some sort of optimization, I might have to use JavaScript anyway.

4. JavaScript is actually quite a nice language to program in.

5. All of the libraries I will be using will be written in JavaScript.

6. wu.js ain't nuthin' ta fuck wit. [1]

Therefore, I'll keep using JavaScript. YMMV.

[1] wu.js is actually quite a killer library: http://fitzgen.github.com/wu.js/

Re: In Which I Tell You to Stop Whining About CoffeeScript

#5
post #4

> Consider the closure syntax in JavaScript: Proceeds to list example that isn't valid JavaScript. I have no fundamental objections with CoffeeScript, but I will never use it because there's nothing wrong with JavaScript that CoffeeScript improves upon. For me, personally, it's way easier to visually scan a file that looks like this: var helloWorld = function () { // ... } Than this: helloWorld -> // ... It's also ea…

I wasn't defining a function in that example, I was calling a function that contained a closure as an argument (in both JS and CS). This is perfectly valid JavaScript.

I've edited the post to be more clear on this.

Re: In Which I Tell You to Stop Whining About CoffeeScript

#6
post #4

> Consider the closure syntax in JavaScript: Proceeds to list example that isn't valid JavaScript. I have no fundamental objections with CoffeeScript, but I will never use it because there's nothing wrong with JavaScript that CoffeeScript improves upon. For me, personally, it's way easier to visually scan a file that looks like this: var helloWorld = function () { // ... } Than this: helloWorld -> // ... It's also ea…

The correct syntax is: helloWorld = ->

You just learn that -> == function() {}

That said, I found it hard to parse until I started working in it for a few weeks and got used to it. Now, reading function() and {} everywhere seems like a mess of boilerplate to me. Really, it is just a matter of what you are used to.

re #3: Also, I can't think of an optimization that JS has that can't be expressed in CS. It just doesn't work like that.

re #5: That seems like a kind of crazy generalization. How can you say that when CS 'compiles' to JS anyway?

Re: In Which I Tell You to Stop Whining About CoffeeScript

#7
post #3

I wish I could say blog posts like this helped the cause, but my feeling after reading it is just meh. I'm fanatic about CoffeeScript but there will always be a divide between people who are willing to try it and people who won't. Writing blog posts that effectively regurgitate the documentation while being a bit religiously pushy about it just seem kind of counter to the cause.

I think for someone who already loves CoffeeScript, this stuff shouldn't be review. This post is intended for people who have specific objections to using it.

Anyway. To each his/her own.

Re: In Which I Tell You to Stop Whining About CoffeeScript

#10
post #8

Source Maps will solve the line number mismatch problem: http://www.html5rocks.com/en/tutorials/developertools/source...

was just about to post this.

Source maps are coming to coffeescript and will solve this. this article doesn't mention them.

Post reply on HN