Hacker News new | ask | show | jobs
by ilaksh 5182 days ago
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.)

1 comments

I think you come close to saying something very important but don't quite explicitly say it so I will.

CoffeeScript is a proxy war between JavaScript and Ruby developers. That's the whole "controversy" over CoffeeScript, to semicolon or not to semicolon, and everything in between.

JavaScript developers feel threatened by the influx of Ruby developers into their space and Ruby developers want to turn JavaScript into Ruby and get rid of those ghastly curly braces that cause them to have a panic attack.

Let's call a spade a spade.

Good point. I hadn't thought of it that way actually but that has got to be part of it.

For me, I sort of skipped over Ruby. I was too busy with other things to really get into it. So since I had more experience (not a lot, but more) with Python than with Ruby, that is what CoffeeScript seems like to me, instead of Ruby.

I always liked Python syntax, its just that I was busy with projects that involved a lot of HTML/CSS/JavaScript/PHP etc.

I have spent years and years writing C#/C/C++/JavaScript/PHP code with curly braces etc. To me, the curly braces and some other stuff are noise. Especially when you get into callbacks and have to remember to keep all of your curly braces and parenthesis straight. Its basically stuff that, as demonstrated by CoffeeScript, the compiler can take care of for you, but in JavaScript it just wasn't taken care of.

In a similar vein, JavaScript (and any other dynamic language or language with static type inference) demonstrates that type declarations aren't necessary, and that a language/compiler can usually take care of that stuff for you.

In a similar vein, C demonstrated (among other things) that managing the stack manually isn't necessary.

Ruby syntax to me is significantly more complicated than CoffeeScript and not really as clean (begin end blocks etc). I think that Rails has some important advantages in terms of software engineering, but the performance and syntax of Ruby turns me off a bit. Still, there is probably more good than bad so I might still end up doing some Rails stuff.

I don't think its advantageous to write an if statement backwards and I think people who wear black wire-rim glasses when they can easily afford contacts or don't even need lenses are ridiculous. I also have never owned a Mac in my life. I dual boot to Ubuntu/Windows 7.