Live data from Hacker News

CoffeeScript is not a language worth learning

github.com

41–50 of 132 posts

Re: CoffeeScript is not a language worth learning

#41

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.

I'm curious if your opinion on this would change if they made it so the browser could run Coffescript natively. Personally, I think the fact that it compiles to an intermediate language to be irrelevant to whether Coffeescript should be considered a language. I consider it a different language if for no other reason than, if a programmer familiar only with Javascript looked at code written in Coffeescript, they would…

If this “running natively in the browser” did not involve 100% cross-compatibility with existing JavaScript code, you might be moving up from jargon to a dialect.

But as long as the underlying model is the same, and as long as it’s a leaky abstraction, I don’t think of it as a separate language.

For example, if it were to be a separate language I would look for its OOP stuff to be implemented in the “engine” and not to be strongly related to the JavaScript prototype mechanism.

Re: CoffeeScript is not a language worth learning

#42
post #40

> 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. This is inane. Haskell used to compile to C. Were they not "language features"?

Clearly my writing is obtuse. Haskell has a language features—lazy evaluation for example—with no equivalent in C. Nothing about lazy evaluation compiles more-or-less 1:1 into C code, it’s a program-wide transformation.

CoffeeScript’s features are all JavaScript features, it’s a simple translation from some shorthand into some other shorthand. CoffeeScript is like the LET macro in ur-Scheme. Powerful, handy, but not a new paradigm, more like some syntactic meta-programming on top of JavaScript’s existing model of programs.

Re: CoffeeScript is not a language worth learning

#43
post #40

> 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. This is inane. Haskell used to compile to C. Were they not "language features"?

Haskell wasn't simply sugaring the regular C design patterns. The C that the compiler generated was nothing like the C that you would normally write.

A better example would be Objective C compiling to C. And I would agree that early Objective C wasn't really a language that added new paradigms to C. It sugared good coding practices for the most part, and did little else. As a result, I generally recommended a combination of the K&R book and the ObjC language spec to learn it -- buying books for ObjC was a waste of time, since it was such a thin wrapper around C.

Coffeescript is in a similar position.

Re: CoffeeScript is not a language worth learning

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

From the coffeescript website: CoffeeScript is a little language that compiles into JavaScript. Underneath all those awkward braces and semicolons, JavaScript has always had a gorgeous object model at its heart. CoffeeScript is an attempt to expose the good parts of JavaScript in a simple way.

Coffeescript has never presented itself otherwise. What causes the confusion is pointless discussions about semantics and people who don't fully understand the point of coffescript teaching other people about it and writing over zealous blogposts.

All programming languages are human convenience. The computer cares not about list comprehensions or splats. It just reads hi/low. Coffeescript is a tool that enables you to write those hi/lows more conveniently. It doesn't care if its called a language or a form of mixed martial arts. It's just there to help you if you want it to.

https://en.wikipedia.org/wiki/Compiler A compiler is a computer program (or set of programs) that transforms source code written in a programming language (the source language) into another computer language (the target language ...)

Re: CoffeeScript is not a language worth learning

#45
post #40

> 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. This is inane. Haskell used to compile to C. Were they not "language features"?

Coffeescript doesn't even have its own standard library, much less a runtime being cross-compiled with its own garbage collector and stack frame constructs.

Re: CoffeeScript is not a language worth learning

#47
Even accepting the basic premise of the article, that CS doesn't strictly give you anything you can't get with JS, I still don't see any of the reason explain why I shouldn't write CS instead.

Even if there are no language features CS gives me over JS (and there are -- list comprehensions to name one), I get cleanliness. The Sapir-Whorf hypothesis is just as relevant in programming languages as in human languages. Equivalent JS being "possible" is not a reason to not write easier to understand and more maintainable code with a language that lets me expend less effort to arrive at the same place.

Re: CoffeeScript is not a language worth learning

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

>> it's an accretion of rewriting tricks

I think you'll find this point of contention won't work against raganwald: https://github.com/raganwald/rewrite_rails

Re: CoffeeScript is not a language worth learning

#50
http://core-js.org

MVC Web Framework for NodeJS written in CoffeeScript.

This is an open source project that has just been released, and from my experience developing it, here are my conclusions:

I believe some people are comfortable coding one way, and others are comfortable coding another. Anyways, everybody uses what works. At the end, the productivity you've got and the time you save is all that matters.

Regarding the issue with the stack traces and CoffeeScript, you're right, line numbers are not accurate, but if you know where the problem is and you'll know how to debug it, on the spot.

I was not attracted to CoffeeScript myself when I first saw it, but after having a closer look, I finally realized it is a great tool to use when applicable. Then I decided to migrate the whole code to CS.

From my experience, it's all about your coding workflow. Knowing CoffeeScript syntax and how it translates to JavaScript. I use CoffeeScript's simplicity to implement complicated concepts that would require some ellaboration when it comes to syntax.

Post reply on HN