Live data from Hacker News

In Which I Tell You to Stop Whining About CoffeeScript

singy.posterous.com

31–40 of 55 posts

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

#31
I don't use CoffeeScript, among other reasons, because honestly it's just another syntax to learn and remember. Despite what people say, it's not "just JavaScript." I write JavaScript everyday, as well as CSS, HTML, Python and PHP. Adding one more syntax layer to the stack, with its due postitives, also comes with its own costs. As for speed, I utilize tab completion in my editor and make advanced use of keyboard shortcuts, which makes my writing/editing more than "fast enough."

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

#32
post #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 d…

> but really boring to type in almost all `for` statements. Use _.each, you're done. Pleasure.

But performance

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

#33
post #24

I wonder where the blow-back is generated from. Personally, and only anecdotal of course, I feel that I have seen a far greater amount of articles extolling the virtues of CoffeeScript than I have seen condemning it. To be honest, that is the only primary source of whatever trace of resentment I feel towards CoffeeScript: I'm just almost bored of hearing about it. ( tongue in cheek ) I don't use CoffeeScript, because…

The top articles about coffeescript posted in r/javascript are anti-coffeescript articles. There are many reasons not to use Coffeescript. Some may claim that 'coffeescript is javascript', it really is not. They say it with a straight face too. People that say this don't really understand the difference between DOM and Javascript, and it is very telling. Just because you can access DOM methods and properties using co…

"The top articles about coffeescript posted in r/javascript are anti-coffeescript articles."

Ah okay, r/javascript isn't in my regular rotation. So as I said, my only evidence is anecdotal.

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

#34
post #26
post #13

Earlier quoted context omitted.

s/professionals/Ruby fans/

I was going for brevity but the downvotes tell me I said too little. CoffeeScript is a tool by and for experts. I don't know where people got the idea it is there to help newcomers. It's clearly an opinionated abstraction that is designed around removing the things that are grating to deal with as professional JS programmers on large code bases. The benefits on a line by line basis are small, but on a large project t…

Part of your comment might be related to why CoffeeScript gets blowback -- there's an implication that if you're not using CoffeeScript, then you're not an expert.

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

#35
I converted some old, overcomplicated, YUI-inspired javascript that relied heavily on class inheritance: big win. I converted some events-gone-nuts code that talked to Google Maps: not a win.

The productivity issue that nobody seems to talk about: the damn compiler is slow. We're talking seconds, but it adds up. (The CSS compilers are far worse.)

I'm used to save/refresh/boom! when coding HTML. Now it's save, contemplate what the hell could possibly take so long, stare sadly at the compile output window, tab, reload, oops, reload again.

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

#36
In my opinion, CoffeeScript is not a language, it's nothing more that an alternative syntax for JavaScript. The argument that one should know CS in order to use a CS library makes no sense, it's nothing more than JavaScript and I cannot stress that enough. Where it helps a lot though is that it does remove a lot of JS bad parts and incorporates common patterns. Extending Array in CS is nothing more than `class Foo extends Array` and it's perfectly compatible with plain JS.

Basically, I do have more of a problems with libraries which add layers of indirection (eg using _.each) at eval time when it could be done on CS at compile time.

So, once again, CS is JS, written a little differently and with some nice bonuses.

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

#37
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…

> It's also easier to grep and sed.

Nobody's* saying JavaScript is a poor storage, transmission, or machine-read format; just that it's not one humans should have to use.

* Some people do say this, of course.

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

#38

in which i tell you to take a look around outside your little bubble, posts on coffeescript (and all posts about software) need to be taken in context. This post's context, it seems, is the type of problem where your pain points are, it seems, "javascript: the bad parts". Coffeescript is pretty great at cleaning up the bad parts and if that's your pain point on a daily basis then coffeescript is probably great for yo…

LOL you're right, the solution to all of JavaScript's problems is LISP.

hahahahaha.

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

#39
post #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 d…

> but really boring to type in almost all `for` statements. Use _.each, you're done. Pleasure.

Except that if you're, say, performing nested iteration, you end up creating a whole crapload of closures, ballooning up memory usage and punishing the GC.

A quick test show that coffeescript's iterator is about three times faster. http://pastie.org/3783184

Underscore's nice, but I really like Coffeescript's iterator sugar.

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

#40
I think a lot of the discussion about why CoffeeScript is or isn't better is really a proxy for the real issue which is, is it worth taking the time to learn it.

People generally are motivated by feelings and the rationalizations come after. For awhile I felt like I did not want to learn CoffeeScript and that it was silly and annoying that people wanted me to waste time learning it. Honestly what really started to change my mind was that I needed to alter PDFKit, and I had to learn a little bit of CoffeeScript in order to do that. I think that the need to learn it came first and then later the rationalizations for why it was a good choice came after.

Another real issue that is below the surface but not mentioned while people are discussing the actual pros and cons of CoffeeScript: is JavaScript a good language, or is it fundamentally flawed somehow?

A professional JavaScript programmer's identity will often be tied in to some degree with his general JavaScript associations (the same way someone who races Formula 1 cars would identify with that type of car and might be offended if someone started attacking the body shape of those cars), and so to make a significant investment in learning CoffeeScript implies fundamental issues with JavaScript and may therefore be an attack on that person's identity. Obviously this wouldn't be a conscious thought process but the subconscious associations are often there.

Whatever is making people choose to learn CoffeeScript or not to learn it, its not really a rational process usually. Its more like a religious battle.

I think that the amount of time you have invested in JavaScript, how well you really know it, to what degree you have come to terms with/got over those pain points that CoffeeScript helps with, how much you identify with JavaScript versus other technologies, whether you actually have a specific need to learn CoffeeScript (i.e. for altering a library or reading a coworker's code), all of those things are going to add up subconsciously in a sort of vector for or against CoffeeScript that is pretty much an emotion which will motivate different rationalizations about specifics.

So in cases where that subconscious equation just isn't adding up in CoffeeScript's favor people will find all sorts of (often tangential) arguments against it. One thing that probably can help if you are trying to push CoffeeScript is to repeatedly mention certain small improvements such as using -> instead of writing function() or the class and extends syntax. That would mean that they would have to learn those things just in the process of the discussion. (Of course, they may want to stab you if you mention those things too many times though.)

Post reply on HN