Live data from Hacker News

CoffeeScript is not a language worth learning

github.com

101–110 of 132 posts

Re: CoffeeScript is not a language worth learning

#101

Why does CoffeeScript have so much "debate" around it? Why don't I see articles saying "Hey guys, stop writing in Erlang! I don't like it! Stop it!" Why does this guy, or anybody that takes the time to write such an article, care what I write in?

Although I don't believe that you finished reading the article -- that's not what "this guy" is saying ... you are raising an extremely good question.

Part of the answer is explained by JavaScript's inherent popularity as the language of the web -- everyone has something at stake, when JavaScript is involved. To paraphrase myself from a similar thread last month:

Most esoteric programming languages are non-threatening. As a hypothetical programmer working on web applications, I can feel safe and comfortable in my ignorance of Haskell, Erlang, D, Io, Arc, and so on. They're far enough outside of the realm of possibility of adoption for my company that I can shrug them off with an "oh, that sounds interesting", and little more. Wanting to adopt one of them would require a whole new development and deployment stack, a new or ported codebase, and new integration costs with the rest of our system. You wouldn't expect to see an article talking about how people using Erlang are creating a "knowledge gap" for Java programmers.

CoffeeScript feels threatening precisely because it is so close to JavaScript, because the code can run with identical performance as hand-optimized JS anywhere that JavaScript can run, because any CoffeeScript library can interoperate seamlessly with any JavaScript library, and vice versa. It forces you, as a reasonable JavaScript programmer, to answer the harder question: Why should you be limited to a language that hasn't changed (IE6/IE7) since 2001?

Re: CoffeeScript is not a language worth learning

#102
post #79

Earlier quoted context omitted.

the question of local vs. non-local transformations at least hints at the idea that a new paradigm or way of thinking about programming is involved. Which is an excellent point, and I think the essay would have been better served if you had oriented it that way, and not around the "not a language worth learning" hook.

I think that essay would be even better than this one. Thanks!

I took part in a discussion of this idea about a month ago: http://news.ycombinator.com/item?id=3198941 There's a paper in there you would want to read as research for that essay.

Re: CoffeeScript is not a language worth learning

#103
post #20

TL;DR: Coffeescript should be seen as a way to enforce good Javascript style, and as such it does a decent job. That's an interesting and very defensible PoV. However, even considered as such, it has some serious warts: * It has no clearly-defined semantics: it's an accretion of rewriting tricks, and as such, it's often very hard to predict how two tricks will interact together, especially when they involve indentati…

"There ought to be one obviously best way to do each thing, for the sake of maintenance and readability."

In what way does a constriction of convention relate to readability or maintainability? The languages I'm most productive in have many ways to write readable code that accomplishes basically or exactly the same thing. I've always considered it a mark of a language's elegance and power that there would emerge multiple ways of expressing the same problem. But maybe we're thinking about different scopes here. Can you give an example?

Re: CoffeeScript is not a language worth learning

#104

Earlier quoted context omitted.

Prototypal inheritance and class inheritance are not one and the same. How do I call super or base in JavaScript? You know this, you had to add it to CoffeeScript. Do you not think the ability to call super functions leads to significantly different design patterns? If not, why did you add it? And why is EmcaScript.next probably going to have it?

Buddy, we're going around in circles here ... Yes, JavaScript lacks a way to easily call "super", but that doesn't mean that the concept doesn't exist. Calling "super" means calling the immediate parent's version of the same function. CoffeeScript is just making it one word: super ... instead of the usual JavaScript prototype hoop jumping: Parent.prototype.method.apply(this, arguments);

We're going in circles because I'm talking about design patterns and you're talking about the ability to add features into JS that weren't in mind when it was designed; it can be a lisp if that's what you want. I'll gladly defer to you on what JS is ultimately capable of, it was never the point of my post. Rather my point is that the different syntax is leading to a divergence libraries and frameworks; Batman.js is a great example of a framework that, while you can consume it from JS, you probably wouldn't want to.

Thanks for the fun back and forth.

Re: CoffeeScript is not a language worth learning

#105
post #20

TL;DR: Coffeescript should be seen as a way to enforce good Javascript style, and as such it does a decent job. That's an interesting and very defensible PoV. However, even considered as such, it has some serious warts: * It has no clearly-defined semantics: it's an accretion of rewriting tricks, and as such, it's often very hard to predict how two tricks will interact together, especially when they involve indentati…

> Now, if we consider CS as a presentation layer for JS, then its proper place is in an IDE, not as a compiler

I disagree. Forcing programmers to use a certain IDE to accomplish productivity gains is a bad road to go down. It discourages innovation, stifles competition and makes it hard to integrate the "compilation" in to other parts of your development cycle.

Re: CoffeeScript is not a language worth learning

#107

Earlier quoted context omitted.

Buddy, we're going around in circles here ... Yes, JavaScript lacks a way to easily call "super", but that doesn't mean that the concept doesn't exist. Calling "super" means calling the immediate parent's version of the same function. CoffeeScript is just making it one word: super ... instead of the usual JavaScript prototype hoop jumping: Parent.prototype.method.apply(this, arguments);

We're going in circles because I'm talking about design patterns and you're talking about the ability to add features into JS that weren't in mind when it was designed; it can be a lisp if that's what you want. I'll gladly defer to you on what JS is ultimately capable of, it was never the point of my post. Rather my point is that the different syntax is leading to a divergence libraries and frameworks; Batman.js is a…

Dude, just admit you’re wrong about what kinds of patterns are natural or common in JS and about what was “in mind” when it was created.

Here are some popular big JavaScript toolkits/frameworks: Closure Library, YUI, Dojo, Prototype, MooTools, ExtJS, Base2, JavaScriptMVC, Backbone.

http://closure-library.googlecode.com/svn/docs/closure_goog_...

http://yuilibrary.com/yui/docs/api/classes/Base.html

http://livedocs.dojotoolkit.org/dojo/declare

http://api.prototypejs.org/language/Class/

http://mootools.net/docs/core/Class/Class

http://docs.sencha.com/ext-js/4-0/#!/api/Ext.Base

http://base2.googlecode.com/svn/version/1.0.2/doc/base2.html...

http://javascriptmvc.com/docs.html#!jQuery.Class

http://documentcloud.github.com/backbone/docs/backbone.html#...

* * *

And here are some other helpful resources:

http://www.aminutewithbrendan.com/pages/20110216

http://www.quora.com/How-was-classical-inheritance-*supposed...

http://www.2ality.com/2011/06/prototypes-as-classes.html

http://ejohn.org/blog/simple-javascript-inheritance/

http://my.safaribooksonline.com/book/programming/javascript/...

http://javascript.crockford.com/prototypal.html

http://bolinfest.com/javascript/inheritance.php

http://dmitrysoshnikov.com/ecmascript/chapter-7-2-oop-ecmasc...

Re: CoffeeScript is not a language worth learning

#108

Earlier quoted context omitted.

So I'm going to learn either JavaScript or CoffeeScript over January. I have some experience in VisualBasic (took a high school programming class about four years ago). Which one should I learn?

Learn Javascript. Coffeescript is defined in terms of Javascript. If you don't know Javascript, learning Coffeescript will be unnecessarily difficult, because you'll have to go back and learn Javascript in bits and pieces as you learn Coffeescript. If you learn Javascript first, learning Coffeescript will be easier, because Coffeescript will build upon your Javascript knowledge.

To re-emphasize this point, there is no "choice" involved. You cannot understand Coffeescript without understanding Javascript... it almost looks like you can at first, but at soon as you start debugging you're back in "what is this prototype thing?"

On the other hand, after you work with Javascript for a little while you quickly start wishing for something like Coffeescript. It's a very natural transition, but you can't short-circuit the process.

Re: CoffeeScript is not a language worth learning

#110

I taught a new programmer in my department JavaScript and CoffeeScript. Yesterday he told me he saw Notch coding a 2d version of minecraft in Java at a hackaton online, and how weird is the difference between CoffeeScript and Java. Maybe for us there's nothing new in CoffeeScript. Heck, the patterns of programming in javascript, callbacks, functional programming, prototypes, closures, the context of this -- for him i…

Interesting that you point out Twitter Bootstrap -- which to me is becoming the great equalizer for new product/startup websites and a hallmark of lack of creativity or any sign of thoughtful design. Sure, the UI is great, much like the design patterns that Coffee script creates -- but what it signifies is a "dumbing down" of design much like Coffee script does to it's programmers.

In Java, good design patterns are defined and publicized, but it's up to the programmer to implement the design pattern, not the compiler. It's that sort of freedom that I feel is necessary for anything truly creative and innovative to be created.

Post reply on HN