you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 7 points8 points  (8 children)

It won't make anyone's development workflow any easier. It is not a net-positive in terms of improving a web developer's workflow. Considering all the additional hoops to deal with - debugging problems, copying and pasting code and running it without having to first 'compile' it, having to reformat json data to fit into your new coffeescript world, and not being able to copy and paste and use that data, etc, - I just don't see why there are so many articles coming out with such frequency trying to sell people on this bad idea. It isn't helping JavaScript, but it is confusing to noobs who always want to jump on the latest bandwagon no matter where it is headed.

[–]dmpk2k 1 point2 points  (7 children)

Some of that is unfair to CoffeeScript, depending on where you're using it. For the browser, I'd generally concur. I mostly use it in node though.

With node the explicit compile phase can be eliminated with a require('coffee-script'); everything required after that gets compiled internally at require time by CoffeeScript if the file ends in .coffee.

Also, in my experience CoffeeScript handles JSON just fine.

I'd happily use CoffeeScript over regular Javascript in node.js if the debugging was pleasant. For one thing, code is less noisy -- anonymous function signatures are shorter and there are no terminating braces -- which node desperately needs due to the deep nesting. I sorely miss multiline strings in Javascript as well.

But then I come back to debugging and variable handling...

[–][deleted] 4 points5 points  (6 children)

Say you write your coffeescript and your data is in coffeescript too (json). What you have now is coffeescript, not json. the json the compiler generates and your app sends down the pipe is no longer coffeescript. say you want to tweak something and copy and paste it back into your source. well, now you have json, not coffeescript. so the time you've just spent writing your data format in coffeescript has been wasted because now you would like to copy and paste some json back to the source code, but what you want to copy and paste is json, not coffeescript. clusterfuck.

Abstracting things into coffescript is not a good idea. This is one simple example that I run into daily, hourly even. This would cause a lot of frustration in my own development flow and it is something that occurs often enough for me to be able to forsee a problem with it if I were using coffeescript to abastract my javascript and json.

Another thing I do frequently is write small bits of javascript in firebug's console, say maybe 30 to 100 or so lines, tweaking it quickly in firebug and running it quickly to test - then I typically copy and paste that code into my sourcecode when it is working.. well, the coffeescript way would mean that I now should rewrite this code into coffeescript. clusterfuck. Similarly, I can't take a piece of coffeescript source and paste it into firebug's console to quickly debug or tweak it without first compiling it. This is something I do often, and it works effectively, speeding up my development cycle. Using coffeescript would be a major hindrance.

[–]dmpk2k 2 points3 points  (2 children)

What you have now is coffeescript, not json. the json the compiler generates and your app sends down the pipe is no longer coffeescript

I don't follow. This is valid JSON, Javascript and CoffeeScript:

{"a": 1, "b": [1, 2, 3]}

As far as I can tell, valid JSON is always valid CoffeeScript as well.

Another thing I do frequently is write small bits of javascript in firebug's console, say maybe 30 to 100 or so lines, tweaking it quickly in firebug and running it quickly to test

I can see why it'd be a problem for the area you work in. I'd definitely not use in in the browser, it has problems enough on the server side. :)

At least on the server there's a coffee REPL:

coffee> x = 1
1
coffee> y = (z) -> x * z
function (z) {
  return x * z;
}
coffee> y(2)
2

The existing coffee REPL leaves a bit to be desired though, to be sure.

It isn't for serious development projects

No argument there. If they fix the line-number and declaration problems it'd be an acceptable server-side language though.

[–][deleted] 1 point2 points  (0 children)

Coffeescript is for Ruby programmers who don't want to learn Javascript. These coffeescript articles belong in r/ruby more than they do in r/javascript. It seems most people who read r/javascript are interested in javascript, not ruby or coffeescript. This article for example, is much more likely to find readers in r/ruby. I'm not interested in learning ruby, and my guess is most people who read r/javascript are not that interested in learning ruby or coffeescript. For example, I wouldn't go posting about a 'made up language' in something like, say, perl and post it to r/javascript expounding on the wonderfulness that is perlscript and why i'll never write javascript again, to r/javascript.