Live data from Hacker News

Poll: Have you moved from JavaScript to CoffeeScript?

news.ycombinator.com

41–50 of 178 posts

Re: Poll: Have you moved from JavaScript to CoffeeScript?

#41
post #31

I don't like the Windows experience of CoffeScript. That's what's holding me back. I think I would use it if it had better Windows support. As far as I know CoffeScript requires node.js, npm and cygwin. Am I wrong?

You can compile CoffeeScript's on Windows with this tool:

https://github.com/alisey/CoffeeScript-Compiler-for-Windows

And it doesn't require cygwin. I haven't tried it myself but it's the route I would go.

Re: Poll: Have you moved from JavaScript to CoffeeScript?

#42
When I first saw CoffeeScript I thought it was the best thing since sliced bread. I mean, it's beautiful to look at (and enjoyable to write). I was positive that it was going to replace JavaScript in my toolbox. Except, for whatever reason, it never did. It may just be because regular old JavaScript is already familiar, but whenever I needed to knock out any client-side code I'd have half the thing written in JS before I'd even think about CoffeeScript.

I guess at the end of the day syntax didn't end up being a killer feature that I needed. I still think CoffeeScript is awesome, but it doesn't solve problems that I can't already solve in JavaScript.

Re: Poll: Have you moved from JavaScript to CoffeeScript?

#43

This is going to be a very interesting poll result. Even 5 or 10% penetration is something remarkable, for a language as widely-used as JavaScript. If you feel like providing any more color beyond your vote, your impressions after using CoffeeScript in anger -- I'd love to hear 'em.

Unfortunately, this poll isn't scientific and you won't be able to trust the results no matter what it says. I expect the poll will show much higher CoffeeScript penetration than it has in reality.

Sure, no HN poll is ever accurate, but as a rough sense, it's still quite useful. For more measured results, you can look at language popularity on GitHub:

https://github.com/languages/CoffeeScript

Re: Poll: Have you moved from JavaScript to CoffeeScript?

#44
post #30

I started using it last month, on production code. I work as a Javascript programmer in an otherwise all-Java software shop. I come from a Python background. I really love it. I have Vim all set up to auto-complete it, to syntax highlight, and to auto-compile whenever I save. The bad news is: No Eclipse plugins, no notepad++ plugins. etc. So the only other devs who can work on it are on Mac and Linux (which to be fai…

There's a 3rd party plugin for PyCharm which has coffee script syntax highlighting. And I think WingIDE for windows supports coffee script as well.

I'm using the former. It's usable, but lacks somethings like fixing indentation errors automatically, and auto-completion. Also the default colors under twilight theme are unreadable, so you have to modify those yourself.

Re: Poll: Have you moved from JavaScript to CoffeeScript?

#45
post #5

Missing option: have moved to CoffeeScript but switched back to JavaScript.

This is me. I love CoffeeScript and can't wait for all it's good bits to filter into JavaScript - but I hate having an "extra step". It's ok while you are actively working on a given project, but I tend to work on projects in big cycles and might not come back to something I was interested in for a year or two. The chances that my two-year-old coffeescript will run in the new versions of the compiler are slim (and my desire to port it low!)

The other day I found the code to a shoot-em-up I wrote in 2002 and it ran in Chrome with no changes required! Sure, the code was very "DHTML"-y, but that's pretty cool!

Re: Poll: Have you moved from JavaScript to CoffeeScript?

#46
I started writing some of my code in coffeescript a while ago, but then I started a coffeescript project that grew into a file of 2000 lines and it became very hard to skim the code and gather meaning from it because of the lack of parenthesis and the indentation-based nature of it.

Re: Poll: Have you moved from JavaScript to CoffeeScript?

#47

This is going to be a very interesting poll result. Even 5 or 10% penetration is something remarkable, for a language as widely-used as JavaScript. If you feel like providing any more color beyond your vote, your impressions after using CoffeeScript in anger -- I'd love to hear 'em.

I've never done front end before (I just hate the JS syntax, so I've avoided it, besides a few jsonp requests) but with CoffeeScript I was persuaded to give it a try. Here is my problem. Nothing is Google-able. Even basic things that I get caught up on the answer on IRC is usually "look up how to do it in JS, and then reform it to CS". Maybe I'm starting on the wrong stuff, but even though the syntax is wonderful, ac…

http://jashkenas.github.com/coffee-script/

http://coffeescriptcookbook.com/

Tutorial/screencast links: http://stackoverflow.com/questions/5124706/is-there-a-screen...

A talk by Jeremy: http://ontwik.com/javascript/jeremy-ashkenas-on-coffeescript...

Re: Poll: Have you moved from JavaScript to CoffeeScript?

#49
post #25

Earlier quoted context omitted.

What's wrong with jQuery callbacks? ;)

jQuery generally abuses (or takes advantage of, depending on your perspective) the value of "this" in its callback functions, in places where it would really be better to have an explicit argument. For example: AccountView.prototype.render = function() { $(".account").click(function(e) { // `this` is now the same as `e.currentTarget` // But `e.target` is also useful. // And you what you really want is for `this` // t…

@jashkensas what you want though would break the way closures are handled in javascript. What you should do if you still want access to Accountview is to trap a variable with a reference to it in the closure. Using your jquery example:

  AccountView.prototype.render = function() {
    $(".account").click( { that: this }, function(e) {
      // 'that' now holds a reference to AccountView
    });
  };
If you don't want to use (or you are using an older version of jquery without the eventData) you could use a closure:

  $(".account").click( (function(that) {
    return function(e) {
      // 'that' now holds a reference to AccountView
    })(this);
  });

Re: Poll: Have you moved from JavaScript to CoffeeScript?

#50
post #20

I evaluated CS but ended up using Script# in my latest project at my day job, mainly because we are Microsoft shop and it will be easier for other C# developers to jump in if the need arises without learning a new syntax.

Trying to use a language that's vastly different to JavaScript to compile to JavaScript is an impedance mismatch that is destined to create more problems than it solves.
Post reply on HN