Live data from Hacker News

CoffeeScript is not a language worth learning

github.com

21–30 of 132 posts

Re: CoffeeScript is not a language worth learning

#21
post #19

Earlier quoted context omitted.

In spoken languages, there is a difference between a language, a dialect, and a specialized vocabulary. My premise is that CoffeeScript is a jargon of JavaScript. Maybe you could say it’s a dialect of JavaScript. But my premise is that notation alone does not make it a distinct language.

Do you think C is a dialect of Assembly?

I can’t speak to whatever C looks like today, but when I first learned it, absolutely positively C was a kind of portable dialect of assembly for an idealized CPU architecture.

For example, the (in)famous equivalence between 10[p] and p[10] point to C being a kind of translator rather than an entirely new way to think about programs.

Re: CoffeeScript is not a language worth learning

#22
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 it's a lot of stuff to learn and unlearn. Sure, I came with experience in ruby and python, so learning coffee script was just one happy afternoon, but for him it is a language worth learning. keep that in mind.

For me, the web is a wild beast we are training. Rails, Coffee Script, and even more importantly - Twitter's Bootstrap are tools we use to express our products in a higher domain language. Bootstrap gives us a common UI for the web that is both beautiful and usable. The fact that I could strap in a day a snappy ajax file upload with plupload into my coffee script view means I have more time to focus on my product instead of my code. That it is less painful to change stuff. Do you ever look at your PHP code from the old days and you admire it? I admire it. I wrote crazy stuff back then. I wrote wrappers and classes and 10,000 lines of utilities just so I can put up a website half the quality of today's websites in double the time.

1. Coffee Script is a DSL for writing damn good websites. 2. (and imho) Coffee Script is a great language.

Re: CoffeeScript is not a language worth learning

#24
post #2

Not sure why it needs the sensationalist title if the author's underlying point is simply that Coffeescript is a pretty good tool for writing nicely patterned Javascript and not a language in and of itself. I guess it is a marketing ploy. I expect it will work.

I usually write these sort of titles because they amuse me rather than in the extreme hope of linkbaiting. I accept that writing for my own amusement has about as much value for others as laughing at my own jokes.

It is a bit of a bait and switch, you don't let people know that you think it is a "damn good tool" until towards the end. I'm ultimately neutral on this. It sort of works to keep your audience engaged with your writing, but is a bit of a cheap trick to not put all your cards on the table until the end of the article.

Oh, and when you are writing you are almost always writing for an audience -- esp. when you tweet the result right afterwards and show up on Hacker News to discuss it.

Re: CoffeeScript is not a language worth learning

#25
post #19

Earlier quoted context omitted.

In spoken languages, there is a difference between a language, a dialect, and a specialized vocabulary. My premise is that CoffeeScript is a jargon of JavaScript. Maybe you could say it’s a dialect of JavaScript. But my premise is that notation alone does not make it a distinct language.

Do you think C is a dialect of Assembly?

Interesting question. After some consideration, I think it depends on whether we are using an optimizing compiler(!) or not.

Re: CoffeeScript is not a language worth learning

#26

> You don't "Think in CoffeeScript," you "Think in JavaScript." Only you think in well-crafted JavaScript. Not true, if only because CoffeeScript includes classes as a language feature. In JavaScript it is a hack. This might change with EmcaScript.next, but for now that creates a significantly different way to design your code. Try writing a Batman.js app in JavaScript and you'll see what I mean. With await/defer pos…

You missed the rest of the essay, wherein Raganwald described how CoffeeScript “features” are a shorthand for common JavaScript design patterns, forcing everyone to use the same patterns in the same way. [In other words, he answered your specific comment at great length, rendering your criticism of one out-of-context quotation a bit weak, eh?]

Specifically, most major JavaScript projects have some kind of class implementation which makes inheritance, creating new classes, &c. easier. Some of these are quite elegant, but they end up being annoying anyway, because each system is slightly different. CoffeeScript takes one particular pattern (which is thankfully compatible with the expectations of Google's Closure compiler) and gives it a shorthand, so that everyone writing CS code will be on the same page.

Re: CoffeeScript is not a language worth learning

#27
post #24

Earlier quoted context omitted.

I usually write these sort of titles because they amuse me rather than in the extreme hope of linkbaiting. I accept that writing for my own amusement has about as much value for others as laughing at my own jokes.

It is a bit of a bait and switch, you don't let people know that you think it is a "damn good tool" until towards the end. I'm ultimately neutral on this. It sort of works to keep your audience engaged with your writing, but is a bit of a cheap trick to not put all your cards on the table until the end of the article. Oh, and when you are writing you are almost always writing for an audience -- esp. when you tweet th…

I see that in addition to choosing a title that displeased you, in responding to you I failed to make it obvious that I agreed with you somewhat. I didn’t say I don’t write for an audience, I said that I selected the title for my own amusement, and that it would be better in some ways to refrain from enjoying my own little joke.

Nothing you have said is wrong.

Re: CoffeeScript is not a language worth learning

#29
I feel bad saying this, because I respect raganwald greatly and I usually enjoy his writing, but this post is somewhere on the border between facile and false. For example:

> CoffeeScript has lots of more subtle transformations up its sleeve, like comprehensions, destructuring assignment, splats, or the "fat arrow" some rail against. Here's the secret to understand: None of these things are "language features" that compile from a language that has them—CoffeeScript—into a language that doesn't have them—JavaScript

Well, CoffeeScript does have these features, and JavaScript really doesn't have them. Would you describe JavaScript as a language that has them? Destructuring assignment doesn't exist in most implementations of JavaScript. It will have that feature later on, but it doesn't now. It also doesn't have comprehensions or splats. That's why the JavaScript that CoffeeScript generates doesn't just use JavaScript's syntax for these features — they aren't there. Instead, you have to do something else that gets the same effect.

This is also ignoring bigger changes, such as the fact that everything is an expression. That isn't true in JavaScript at all, and can't be mimicked with anything that even vaguely resembles it. You have to do what CoffeeScript does in the generated JS — constantly be storing intermediate values at the place where they're produced and assigning them afterward if you want to get a value out of most constructs (such as an if).

The two languages do correspond pretty closely, and that's intentional. But the same is true for C and machine language. If you think that C is just a shorthand for machine language, I guess you're welcome to your opinion, but you're pretty lonely with that one.

Any source language can be said to be a simple transformation of its target language, since that's what a compiler does. That doesn't mean they're the same.

Re: CoffeeScript is not a language worth learning

#30

> Ryan Florence argues that if people use CoffeeScript to write JavaScript programs, maintenance will be a nightmare: I posted that article a little prematurely and more as a rant for my co-workers. It was a bit misunderstood (and it blew up online before I even knew it so I didn't bother editing). My point in that quote was that bad CoffeeScript is worse than bad JavaScript. Good CoffeeScript is better than good Jav…

> Good CoffeeScript is better than good JavaScript. Bold statement, explanation?

major fail
Post reply on HN