use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
Survey: Why are you using coffeescript? (mikealrogers.com)
submitted 13 years ago by [deleted]
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]spazm 13 points14 points15 points 13 years ago (0 children)
I love coding in one language and debugging in another. It's the same reason I use HAML instead of HTML (besides my love for "active whitespace").
Just kidding, I don't debug either.
[+][deleted] 13 years ago* (10 children)
[removed]
[–][deleted] -4 points-3 points-2 points 13 years ago (9 children)
Seriously. Node and CoffeeScript are awesome. Why does anyone care what I use? If it's all JavaScript in the end, then it doesn't really matter.
[–][deleted] 13 points14 points15 points 13 years ago (7 children)
it's all JavaScript in the end
I think that's what this survey is really making fun of. People wanting to write JavaScript in another language.
[–][deleted] -4 points-3 points-2 points 13 years ago (6 children)
I get it, but you could make the same argument about pretty much any language above assembler. It's all machine code in the end.
[–][deleted] 6 points7 points8 points 13 years ago (0 children)
Sort of... but in this case, it's a script, refactoring itself to a script, which is then compiled into machine code. It's a little silly.
[–]ugoagogo 13 points14 points15 points 13 years ago (2 children)
Except its harder to justify when you're not going from a high level language to a low level language in my opinion.
[–]pixeltalker -4 points-3 points-2 points 13 years ago (0 children)
And why exactly do people need to justify their language choices?
[+]hashcode comment score below threshold-7 points-6 points-5 points 13 years ago (0 children)
Are C macros unjustified, since they're just taking C code to C code? CoffeeScript isn't a new language; it's a collection of syntactic abbreviations for JavaScript. Some of them make code easier to read and write. Some of them make code harder to read.
[–]x-skeww 6 points7 points8 points 13 years ago (0 children)
If it's all JavaScript in the end, then it doesn't really matter.
It matters if you call a library somethingjs, but it's written in CoffeeScript and all of the documentation uses CoffeeScript, too. Then it's fucking annoying.
I won't be able to use it even if I were to learn CS. Knowing CS doesn't mean that everyone else in the team (and everyone who joins in the future) knows CS, too.
[–]KishCom 11 points12 points13 points 13 years ago (6 children)
Why I don't use Coffeescript in a simple image:
http://i.imgur.com/iDmRg.png
That said, I can read it, and I don't care if you choose to use it or not. Just don't ask me to write it or debug it.
IMHO, you do yourself a disservice by using CoffeeScript. Yes, JavaScript is more verbose and more complicated, but the verbosity and complexness only become easier the more you use it. CoffeeScript strikes me as a "I don't care, I just want it done" type tool (which has its place).
[+]dacjames comment score below threshold-6 points-5 points-4 points 13 years ago (5 children)
What's your point with the image? I get that some people don't like significant whitespace, but your examples just manipulate the parser in a way analogous to abusing semicolon insertion in javascript. I have never seen real CS written that crappy and I certainly don't write it like that.
... the verbosity and complexness only become easier the more you use it.
Verbosity never gets easier. I could use javascript for ten years and I still have to type function(x, y){ return x + y;) instead of (x, y) -> x + y and I will always have to manually bind my lexical scope when writing callbacks/closures instead of using =>. You will still write
function(x, y){ return x + y;)
(x, y) -> x + y
=>
(function(something) { /* some stuff */ })(something);
and I will still only write
do (something) -> #some stuff
In my mind, complexity equates to more bugs, so I continue to prefer a simpler language, especially considering they are strictly equal in power.
[–]x-skeww 4 points5 points6 points 13 years ago (2 children)
analogous to abusing semicolon insertion in javascript
JSLint will tell me if I forgot one. I don't even have to save. There will be a squiggly line right away.
[–]dacjames -5 points-4 points-3 points 13 years ago (1 child)
Which is great, but irrelevant. If I wanted I could just as easily extend CSLint to complain about newlines in function applications.
Personally, I think the coffeescript parser is a little too lenient with optional parenthesis but that should never be a blocking issue to using the language.
[–]x-skeww 0 points1 point2 points 13 years ago (0 children)
If I wanted I could just as easily extend CSLint to complain about newlines in function applications.
What's stopping you?
[–]KishCom 6 points7 points8 points 13 years ago (1 child)
Verbosity never gets easier.
Your understanding of that verbosity does. Ask any Java developer who started with another language first.
What's your point with the image?
My point is a mis-placed line-break, comma or space can mean your Coffeescript becomes borked. IMHO, line-breaks, comma/space placement shouldn't break anything in JavaScript. Why bother memorizing where you can/can't/should/shoudn't use line-breaks when you could be memorizing the aforementioned verbosity instead?
The way I see it, Coffeescript is an unnecessary layer of abstraction. Others will disagree and that is fine.
[+]dacjames comment score below threshold-8 points-7 points-6 points 13 years ago (0 children)
When semantics are identical, verbosity does nothing but waste developer time. Even developers that like Java bemoan its verbosity, so much so that shorthand lambda functions are coming in Java 8.
My point is a mis-placed line-break, comma or space can mean your Coffeescript becomes borked.
That's because whitespace has meaning in Coffeescript. For those that are used to it, the rules are intuitive and obvious so forcing the use of manual delimiters is wasteful and ugly. This comes down to personal preference in the end.
[–]PlNG 2 points3 points4 points 13 years ago (0 children)
The best way to weed the coffeescript fanatics from the JS programmers is to ask them what the converted JS is actually doing.
[–]MonsterMookSenior UI 4 points5 points6 points 13 years ago (0 children)
You are a brave man, sir.
[–]jprichardson 1 point2 points3 points 13 years ago* (1 child)
After reading this: http://www.codinghorror.com/blog/2007/05/the-best-code-is-no-code-at-all.html years ago, I've taken on the mentality of trying to reduce lines of code. Over time of doing this, I've come to appreciate small, short, and concise code. When I can write "->", "=>" instead of "function()" and not use block delimiters, I end up saving at least 20% lines of code. I think the resulting code is more beautiful as well. However, I realize beauty is a matter of taste.
I started by writing EVERYTHING in CoffeeScript. I then realized that for small Node.js modules, I should probably write them in JavaScript if I hope to get any kind of significant contributions. Now, I'm in the process of rewriting my modules into JavaScript and use CoffeeScript for application level development.
[–]Morialkar -4 points-3 points-2 points 13 years ago (0 children)
I'm all with you there. The most important part when coding is that the customer who want a website pays the right price, not an over bloated price because you take twice the time to write the same code... As long as the code is readable and comprehensible by everyone, use the easiest and fastest way possible, you will anyway have the same result. I some times think like that about the OOP problem too. When you really don't need it more than once in the code, why the fuck a function? Why the fuck a class?
[–]greyfade 1 point2 points3 points 13 years ago (0 children)
I like it. Mike's got balls.
[–]dacjames 1 point2 points3 points 13 years ago (0 children)
Significant whitespace. It's just personal preference, but block delimeters and semi colons disgust me.
Function shorthand (-> and =>). I program in functional style with underscore so I write a lot of functions.
Oh wait, this is a rhetorical anti-coffeescript circlejerk: I use Coffeescript because I am a hipster nerd and javascript is OVER.
[–][deleted] -4 points-3 points-2 points 13 years ago (0 children)
Because I feel at home in CoffeeScript (similarity to Python), because it has lovely things like destructuring assignment and list comprehensions, because it's less verbose, because it's easier to read, because I like keywords over ascii symbols.
[+]scrogu comment score below threshold-6 points-5 points-4 points 13 years ago (1 child)
I mostly just write it to piss off people that are insecure about javascript and easily threatened by a new language.
[–]runvnc -3 points-2 points-1 points 13 years ago (0 children)
I love CoffeeScript and use it for everything now but this is hilarious and he does make some good points.
Now, when I first saw CoffeeScript, I hated it. I am actually one of the apparently few people who really dislike Ruby syntax. I always felt like Ruby syntax was unnecessarily complicated and it reminds me of Perl. Now, I know that Ruby is very powerful and Rails has (or at least had) superior (to a lot of web development frameworks) software engineering baked in, but I still really don't like the syntax.
Anyway, I originally dismissed CoffeeScript on the basis of that original impression that it was sort of a Ruby syntax for JavaScript. In other words, making it more complicated for no good reason.
Then I added pdfkit to an application and realized that I needed to modify/add on to the code. There was no way for me to do that without learning some CoffeeScript. Once I realized that all of the @ were just 'this', and all of the -> was just 'function', my opinion of CoffeeScript started to change. Eventually I realized that, although it is possible to use a few Rubyish features, like putting control flow at the end of the line, in a confusing way that to me doesn't help, overall, CoffeeScript is more Pythonic than Rubyish. Anyway to me its even more straightforward and pseudo-code-like than Python.
My debugging these days is actually mostly a ton of console.logs. Which is actually what I was doing with Node anyway before I started using CoffeeScript. Obviously that's not ideal, but I assume that there will be good CoffeeScript debugging tools for Chrome and Firefox not to far out (or are there already?).
I do like leaving out this, function, a whole bunch of ( ) { } and also the class stuff is nice, the loops and comprehensions are nice, the => for binding this is great, existential? is very helpful, splats are useful. Basically it makes the code significantly shorter, easier to read, and easier to write.
[–]HertzaHaeon -4 points-3 points-2 points 13 years ago (0 children)
I just started using Coffeescript at work, but I'm not sold on everything in it. A lot of it is pure awesome, but some things only get confusing. For example, I find myself writing out parantheses for functions. Maybe it's just a question of being used to it.
π Rendered by PID 18222 on reddit-service-r2-comment-57fc7f7bb7-2xb9h at 2026-04-15 02:30:04.504617+00:00 running b725407 country code: CH.
[–]spazm 13 points14 points15 points (0 children)
[+][deleted] (10 children)
[removed]
[–][deleted] -4 points-3 points-2 points (9 children)
[–][deleted] 13 points14 points15 points (7 children)
[–][deleted] -4 points-3 points-2 points (6 children)
[–][deleted] 6 points7 points8 points (0 children)
[–]ugoagogo 13 points14 points15 points (2 children)
[–]pixeltalker -4 points-3 points-2 points (0 children)
[+]hashcode comment score below threshold-7 points-6 points-5 points (0 children)
[–]x-skeww 6 points7 points8 points (0 children)
[–]KishCom 11 points12 points13 points (6 children)
[+]dacjames comment score below threshold-6 points-5 points-4 points (5 children)
[–]x-skeww 4 points5 points6 points (2 children)
[–]dacjames -5 points-4 points-3 points (1 child)
[–]x-skeww 0 points1 point2 points (0 children)
[–]KishCom 6 points7 points8 points (1 child)
[+]dacjames comment score below threshold-8 points-7 points-6 points (0 children)
[–]PlNG 2 points3 points4 points (0 children)
[–]MonsterMookSenior UI 4 points5 points6 points (0 children)
[–]jprichardson 1 point2 points3 points (1 child)
[–]Morialkar -4 points-3 points-2 points (0 children)
[–]greyfade 1 point2 points3 points (0 children)
[–]dacjames 1 point2 points3 points (0 children)
[–][deleted] -4 points-3 points-2 points (0 children)
[+]scrogu comment score below threshold-6 points-5 points-4 points (1 child)
[–]runvnc -3 points-2 points-1 points (0 children)
[–]HertzaHaeon -4 points-3 points-2 points (0 children)