Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

If you can't be bothered to learn the behavior of keywords as fundamental to JavaScript as "var" and "this," then yes, you'd better be using some wrapper. Items (3) and (5) seem to be the only valuable features demonstrated here, and (5) should be present in the ES Harmony (it is already present in JS 1.7).

The article states that

> It’s about more agile code

but I find this claim dubious when the best JS tools are for JS, and not CoffeeScript. I believe that the features provided by the Closure compiler are more beneficial for stable JavaScript development (annotations, etc), and carry a significant performance incentive.



Without agreeing or disagreeing with your conclusion, I'm not sure I understand what you're reaching for with the opening sentence: If you can't be bothered to learn the behavior of keywords as fundamental to JavaScript as "var" and "this," then yes, you'd better be using some wrapper.

That seems to be trivially true, but in context it only makes sense if you're implying a bi-conditional, namely that the only reason to use a wrapper is if you don't understand var and this.

I believe that to be false. There are many reasons to use syntactic or semantic sugar even when you understand the underlying language very well. As a demonstration of this, I give you that most tools of this type are written by people who understand the underlying languages incredibly well and design such tools for their own use as relative expert users.


Oh, I just meant that those (confusion with `this` and `var`) were pretty silly things to point to in praise of CoffeeScript, as they are so easy to understand and fundamental to JavaScript. Like you said, CoffeeScript is aimed at a broader audience than those who can't grasp JS basics.


The problem is not confusion about them, or inability to figure them out, per se. Dealing with syntactic awkwardness and features full of tricky corner cases takes mental effort even if you can understand them perfectly. Coffeescript let you (to a greater extend than JavaScript) write and read just the code you mean, without having to think explicitly about these questions every time. You still have to understand JavaScript in a fairly deep way to build solid CoffeeScript programs.


I for one am quite dubious when it comes to the idea of people learning Coffeescript "instead" of Javascript. I don't think you should pick up CS until you have at least a moderate understanding of JS.

Also, I don't think CS is a tool to abstract away these problems from DEVELOPERS...that is, it's not so developers don't have to understand these issues...it's a tool to abstract away these problems from your CODE...so that you don't have to write all sorts of repetitive, dense, and gnarly code to work around all this stuff

. A lot of times when Coffeescript comes up, people think that it's purely for people that don't "understand" Javascript, but this is not the case at all. I know some supremely knowledgeable Javascript developers who have adopted it.

Tooling is, imho, one of the biggest drawbacks of Coffeescript at this point; however it's making progress. Coffeescript produces fairly clean and readable code (though it is very verbose), and it also has pass-through syntax for both code and comments...so tools like Closure Compiler could be used on the generated Javascript without a whole lot of trouble.

Some tools can be adapted by the user to use CS, and in other cases the creators are working to support Coffeescript (there are some at Mozilla who want to add debugging, etc support for CS). In cases where all else here fails, the community is working on providing Coffeescript versions.

Some people may not want to use it, or may be unable to due to some tool or workflow not being supported; but I've found most JS devs I know able to pick it up and use it quite easily with good returns.


I don't think the point is "you won't need to learn how these work!"; rather, it's "you don't need to worry about using the normal convoluted ways of dealing with these". It's never claimed that => implies (ha, logic humor) that you don't need to know how this works, just that => helps you deal with a common annoyance found with using this.


My main point is that only those who cannot be bothered to learn the language's finer points (I don't consider these to be amongst them, but as indicated by this blog post, others do) will reap significant benefits from using a tool such as CoffeeScript. Anybody else would be sacrificing too many useful JavaScript-specific tools to justify the benefits of a slightly more expressive language.


> Anybody else would be sacrificing too many useful Javascript-specific tools...

What exactly do you mean by this? What is there that you can do in Javascript that you can't do in Coffeescript?


> the language's finer points

I wouldn't call those "finer" points.


You don't read parentheses.


Very much agree. I fully understand the scoping of "this" but that doesn't stop me from hating life every time I have to write "var self=this;".

In other languages I can put up with a reasonable amount of pain but "this" and dealing with loops in JS puts me over the edge.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: