Live data from Hacker News

In Which I Tell You to Stop Whining About CoffeeScript

singy.posterous.com

21–30 of 55 posts

Re: In Which I Tell You to Stop Whining About CoffeeScript

#21
It's a matter of taste.

If you like Ruby, check out CoffeeScript.

If you don't now there's Google Dart. The IDE is pretty nice.

None of the above? Closure Compiler, jshint etc. are your friends.

Edit: a good article about "verbal vs visual" programming languages: http://ryanflorence.com/2011/2012/case-against-coffeescript/

Re: In Which I Tell You to Stop Whining About CoffeeScript

#23
post #14

My primary issue with CoffeeScript: people that use it insist that it's JavaScript. Example: I see a post on HN or in one of my RSS subscriptions about a great new JS library or plugin, only to click through and see a page full of CoffeeScript examples, and the source code is written in CoffeeScript as well. This is not JavaScript. I will not learn CoffeeScript just to decipher your plugin or library and integrate it…

> My primary issue with CoffeeScript: people that use it insist that it's JavaScript.

Because, semantically, it is the same as JavaScript (for the most part). It just looks different.

Re: In Which I Tell You to Stop Whining About CoffeeScript

#24

I wonder where the blow-back is generated from. Personally, and only anecdotal of course, I feel that I have seen a far greater amount of articles extolling the virtues of CoffeeScript than I have seen condemning it. To be honest, that is the only primary source of whatever trace of resentment I feel towards CoffeeScript: I'm just almost bored of hearing about it. ( tongue in cheek ) I don't use CoffeeScript, because…

The top articles about coffeescript posted in r/javascript are anti-coffeescript articles.

There are many reasons not to use Coffeescript.

Some may claim that 'coffeescript is javascript', it really is not. They say it with a straight face too. People that say this don't really understand the difference between DOM and Javascript, and it is very telling. Just because you can access DOM methods and properties using compiled coffeescript does not mean that the coffeescript syntax IS javascript, and nothing could be further from the truth. DOM is DOM. Javascript is Javascript. Coffeescript is Coffeescript. Confusing them just makes someone look like they don't know what they are talking about.

Anyway, javascript has been the only language used to code front-end websites for quite some time (thankfully vbscript in IE is not used any more) and as a result it has become very well know, widely written about, and quite a lot of code has been written in it. There is a wealth of experience and all the 'gotchas' are well documented and there aren't really that many of them if you don't count anything to do with the DOM. Coffeescript introduces its own gotchas. While it may fix/avoid a few of javascript's gotchas, it introduces its own. And worse, there are new releases of coffeescript that break compatability, so much that the latest version of coffeescript now adds a comment at the top of any generated code with the revision of coffeescript used to create the "transpiled" code. If you think changing the rules of the language regularly is a good way to develop software, then we don't have anything further to talk about.

There are limitations to coffeescript that make it difficult to work with. You can't have the same variable name used twice in the same source file. The var command is ambiguous, and coffeescript's syntax is generally more ambiguous than javascript leading to programmer error. It is more difficult to read coffeescript because of ambiguity that you don't get with C style syntax. Javascript uses clear delimiters { } for where things begin and end, coffeescript does not and this means 'less typing' in coffeescript, but at the cost of readability. Some say coffeescript is easier to read, more power to them. Hopefully I'll never have to read their code.

Re: In Which I Tell You to Stop Whining About CoffeeScript

#25
post #21

It's a matter of taste. If you like Ruby, check out CoffeeScript. If you don't now there's Google Dart. The IDE is pretty nice. None of the above? Closure Compiler, jshint etc. are your friends. Edit: a good article about "verbal vs visual" programming languages: http://ryanflorence.com/2011/2012/case-against-coffeescript/

Or you could, you know, just learn javascript like a billion other people.

Re: In Which I Tell You to Stop Whining About CoffeeScript

#26
post #13
post #9

Javascript for novices? On the contrary, CoffeeScript is Javascript for professionals .

s/professionals/Ruby fans/

I was going for brevity but the downvotes tell me I said too little. CoffeeScript is a tool by and for experts. I don't know where people got the idea it is there to help newcomers. It's clearly an opinionated abstraction that is designed around removing the things that are grating to deal with as professional JS programmers on large code bases. The benefits on a line by line basis are small, but on a large project these small things (unfairly labelled as sugar) compound into large scale effects like a cleaner, leaner code base.

Re: In Which I Tell You to Stop Whining About CoffeeScript

#27
post #25
post #21

It's a matter of taste. If you like Ruby, check out CoffeeScript. If you don't now there's Google Dart. The IDE is pretty nice. None of the above? Closure Compiler, jshint etc. are your friends. Edit: a good article about "verbal vs visual" programming languages: http://ryanflorence.com/2011/2012/case-against-coffeescript/

Or you could, you know, just learn javascript like a billion other people.

That's the "None of the above" part.

All of these are just tools to help you get it right. Even with plain JavaScript you will need tools. jshint for example is awesome.

Re: In Which I Tell You to Stop Whining About CoffeeScript

#29
post #4

> Consider the closure syntax in JavaScript: Proceeds to list example that isn't valid JavaScript. I have no fundamental objections with CoffeeScript, but I will never use it because there's nothing wrong with JavaScript that CoffeeScript improves upon. For me, personally, it's way easier to visually scan a file that looks like this: var helloWorld = function () { // ... } Than this: helloWorld -> // ... It's also ea…

The example given is valid js...

Nobody is "force-feeding" you anything, just close your browser tab. If you missed the top of the article, it's the author that was offended first for using CS, there's no need to continue calling names.

And please drop the straw man arguments:

> 1. In order to debug CoffeeScript, I will need to know JavaScript.

Of course, and that's the beauty of it. CoffeeScript is a tool to write javascript.

> 2. If I run into a tricky problem, not only will I need to know JavaScript but I'll also need to know the CoffeeScript compiler's internals.

You never have to know the CS compiler's internals. The output is always valid (if it wasn't that would be a serious bug, not a problem in your script).

> 3. If I run into a really tricky problem, or if I need some sort of optimization, I might have to use JavaScript anyway.

Optimization can be done in CoffeeScript itself 99% of the times, and it already outputs very efficient javascript.

> 5. All of the libraries I will be using will be written in JavaScript.

Yes, that's nice isn't it? They all interact perfectly fine with your CS code.

Re: In Which I Tell You to Stop Whining About CoffeeScript

#30
post #14

My primary issue with CoffeeScript: people that use it insist that it's JavaScript. Example: I see a post on HN or in one of my RSS subscriptions about a great new JS library or plugin, only to click through and see a page full of CoffeeScript examples, and the source code is written in CoffeeScript as well. This is not JavaScript. I will not learn CoffeeScript just to decipher your plugin or library and integrate it…

The output is there for you to take. It is javascript.
Post reply on HN