Live data from Hacker News

CoffeeScript Means Giving Up on JavaScript

w2lessons.com

11–20 of 71 posts

Re: CoffeeScript Means Giving Up on JavaScript

#11
I think it's a good tool. It allows you to produce better code faster. Writing CoffeeScript while reading the resulting JavaScript can probably help you to learn "the good parts" faster. (I'm not saying you shouldn't learn JavaScript 'properly', if you need to deliver a significant quantity of it.)

I've been spending a lot of time writing Boo and reading C#. My intention was to put off learning C# for awhile, at least until after I ship my current project. I'm working on finishing my first game with Unity3D (and quickly developed an aversion to UnityScript).

Boo is an absolute joy to use, btw.

The funny thing is that I'm kind of learning C# by accident, by reading it (and the BCL docs) and writing Boo.

Will I at some point switch to C#? I strongly doubt it. Boo allows me to move much faster, produces cleaner, nicer-looking code, and compiles to equivalent CIL. It's all win, as I see it.

Re: CoffeeScript Means Giving Up on JavaScript

#12
Seriously, there needs to be something that shows the way to the future. The people working on the next version of ECMAScript look to languages like CoffeeScript as archetypes of the future.

More then anything CoffeeScript shows us what Javascript might look like someday.

We get to actually try out new idioms and see if they work for us. If they don't we have ample time to voice concerns. This is a huge departure from the past.

If anything CoffeeScript will make Javascript better.

Re: CoffeeScript Means Giving Up on JavaScript

#13
I'm not sure that this conclusion follows nor am I sure that discussions like this accomplish anything. CoffeeScript makes it easier to write "correct" JS and patches an institutional bug: Javascript's development crawls along. Even if it didn't the browser-as-environment handcuffs developers from taking advantage of new language features. (Have you used JS array comprehensions? No, because browser support is spotty, unreliable). And even in the best of development climates -- a thousand genius hackers ardently updating the code base -- these environmental restrictions would persist, drawn over the frame of IE-Mozilla-Google conflict and competition.

So we have languages that compile to JS that let the language evolve. I use CoffeeScript sometimes and JS sometimes. I'm not going to waste the time in the write-compile CoffeeScript loop for 100 lines of JS that I can write correctly. However, I no longer have to work on a 2k LOC, complex JS app without all the niceties of CoffeeScript. Furthermore, if I'm doing something that benefits from the special expressivity of a Lisp, I'll use clojurescript. If I'm very adventurous (and I need to write, say, an H.264 decoder), I'll use emscripten after any language that compiles to LLVM first.

But these are all for different uses, often things you would never have used POJS for anyway. It's not a discussion of plain ol' JS versions of H.264 encoders vs those made originally with Emscripten. It's a discussion of them not existing at all before, and now having the ability to express them and compile to JS. It's not a question of the old enormous apps we built in JS to the new, simpler ones we express in CoffeeScript. It's a question of not being able to build/maintain 5k LOC in POJS across many developers (whereas this task is less substantial in CoffeeScript). Live and let live and everyone benefits.

Re: CoffeeScript Means Giving Up on JavaScript

#14
> CoffeScript Means Giving Up on Javascript

It absolutely does not.

There is one good point from this article :

"Anyone who uses a Javascript library should know Javascript well or they will run into problems with large applications"

The rest of the post is an attempt at instilling a granny-state fear for the Javascript scene.

There will always be people using technology they don't understand. Why are you so concerned about it?

Re: CoffeeScript Means Giving Up on JavaScript

#15
To quote the author: "For the extra effort you'll make learning CoffeeScript and its idiosyncrasies, why not put it towards really learning JavaScript?"

There are so many wrong saying in this statement.

First, understand that CoffeeScript is JavaScript - but without its idiosyncrasies. If you know JavaScript really well, learning coffeescript takes minutes. CoffeeScript embraces closures and prototype inheritence; it just makes it less cumbersome to use.

Second, who said that programming in CoffeeScript means you don't really know JavaScript? CoffeeScript let you write better code in less line. (By better I mean easier to maintain and read). Furthermore, CoffeeScript programmers tend to choose it because they enjoy coding in Javascript and want to keep using it. What is way more scary is maintaining codes of designers who use jQuery without understanding Javascript.

Third, I hate the "For the extra effort" part. It's like saying, either you learn Python or C++; you can't learn both so better spend the time learning C++. It's just totally wrong. Good programmers tend to enjoy learning new technologies and paradigms. I'd even go further by saying that learning CoffeeScript will make you a better JavaScript programmer.

Re: CoffeeScript Means Giving Up on JavaScript

#16
post #4

You can't write a program in C without knowledge of assembly, unless you're willing to defer debugging to someone who does. You can't write a line of code in any language if you don't know, on some level, what it's doing in the machine (whether physical or virtual). Sure, you can , but you're not a programmer, you're a tinkerer. To really program, you need to know assembly. But at some scale, your application becomes…

> To really program, you need to know assembly.

That's just an absurdly untrue statement.

Re: CoffeeScript Means Giving Up on JavaScript

#17
This article screams of: "I dont want to learn CoffeeScript, Don't use it!"

His basis of not having to learn CoffeeScript is that he uses structural js frameworks? Like somehow CoffeeScript prevents you from doing that?

I'm all for sound reasoning showing pitfalls of certain languages - which despite its wordiness, the article demonstrates a severe lack of. IMO the biggest reason not to use CoffeeScript is the lack of a good debugging experience. Although that's about to get better with soon being able to write source debug symbols in js for transpiled languages.

At the same time the JavaScript language is constantly improving (albeit slowly), which ideally would mitigate the need for CoffeeScript / Dart / etc. But that's not going to be available in mainstream client js programming for years to come. In the meantime feel free to use what language you feel more productive in - and stop trying to impose your personal taste onto others.

Re: CoffeeScript Means Giving Up on JavaScript

#18
post #4

You can't write a program in C without knowledge of assembly, unless you're willing to defer debugging to someone who does. You can't write a line of code in any language if you don't know, on some level, what it's doing in the machine (whether physical or virtual). Sure, you can , but you're not a programmer, you're a tinkerer. To really program, you need to know assembly. But at some scale, your application becomes…

this is exactly what I was think while reading the post! at some point abstraction isn't just a something to geek out on, it is necessary.

maybe the problem is not know some assembly or at least some C when you write Objective-C or C++ you can write some really bad, inefficient code if you don't know the work the language underneath has to do. the same goes for the DOM and Javascript our assembly on the web.

Re: CoffeeScript Means Giving Up on JavaScript

#19
post #4

You can't write a program in C without knowledge of assembly, unless you're willing to defer debugging to someone who does. You can't write a line of code in any language if you don't know, on some level, what it's doing in the machine (whether physical or virtual). Sure, you can , but you're not a programmer, you're a tinkerer. To really program, you need to know assembly. But at some scale, your application becomes…

The situation of CoffeeScript and Javascript isn't the same. All the existing debugging tool will only show you Javascript code when you want to debug. C is different on that point. Almost all (if not all) the IDE in which you can code and debug allow you to debug without having to ever see any line of assembly. You don't have to understand the generated assembly code to code in C, because you will never have to look at it.

The situation of CoffeeScript would be like C if the only way to debug C code was to debug it in assembly.

Re: CoffeeScript Means Giving Up on JavaScript

#20
post #15

To quote the author: "For the extra effort you'll make learning CoffeeScript and its idiosyncrasies, why not put it towards really learning JavaScript?" There are so many wrong saying in this statement. First, understand that CoffeeScript is JavaScript - but without its idiosyncrasies. If you know JavaScript really well, learning coffeescript takes minutes. CoffeeScript embraces closures and prototype inheritence; it…

> Good programmers tend to enjoy learning new technologies and paradigms.

You've stumbled onto a pet peeve of mine. I think it's rather that people who like learning new programming languages like labeling people like them as "good".

The flip side of the coin is that there's a huge intersecting set of attention-deficit afflicted dabblers who play with a large number of technologies and master none of them. I enjoyed learning programming languages when I was 14. I'm 31 now, and now I like solving actual problems. If I need to learn a new technology to do so, so be it, but there's rarely much joy in such.

I believe you'd find the opposite true if you surveyed more mature fields: master craftsmen tend to be stubborn about the tools they use, but know them inside out.

Post reply on HN