9 ms·
Poll: Have you moved from JavaScript to CoffeeScript?
Question asked over here:
http://news.ycombinator.com/item?id=2683302
Not sure why it wasn't an actual poll - maybe they don't have enough karma. Anyway, here is an actual poll. Feel free to comment as to reasons or other possibilities.
- Stwerner 15y agoI still use javascript, but I am intrigued by CoffeeScript enough that I can see in myself starting to use it in the near future, once I get time to work through the PragProg CoffeeScript book.
- bryanlarsen 15y agoMissing option: will be using CoffeeScript on my next project.
- paulbjensen 15y agoYes
- settrans 15y agoMissing option: have moved to CoffeeScript but switched back to JavaScript.
- mrspeaker 15y agoThis 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!
- paulbjensen 15y agoyes
- amirshim 15y agoCoffeeScript is amazing, I use it for everything including writing native iPhone apps (using titanium). Search for Album Plus in the app store. or visit http://www.albumpl.us/ http://www.albumpl.us/
- StavrosK 15y agoI checked out your app, very interesting how native it feels. Would you recommend Titanium, in general?
- amirshim 15y agoTitanium is a mixed bag. For simple applications, it's great, but as soon as you need to do something a little bit complicated, the learning curve goes up quite a bit. For example, in my app (http://iphone.albumpl.us http://iphone.albumpl.us) I had to write a couple of small custom objective-c modules to get some camera/image stuff to have sufficient performance. But overall being able to write most of it in CoffeeScript, is so much better (enjoyment-wise and speed-wise) than having to write everything in objective-c.
- stephenr 15y agoNope. I like my parens, braces and keywords thanks.
- Hovertruck 15y agoI have nothing against CoffeeScript, and I've used it on a few things, but in general I find JS to be an enjoyable language to work in. If I had more issues with the syntax or something, I might find the switch to CoffeeScript worthwhile.
- tomp 15y agoAgree. CoffeeScript has great syntax that I find very inspiring and might incorporate into my own language someday, but all in all, javascript is not that bad... at least not the parts that CoffeeScript can fix.
- slouch 15y agoYes, and why would I want less of JavaScript's syntax in my life when it has so much overlap with other languages I use like PHP?
- Peaker 15y agoWell, you do choose Javascript when you could have chosen PHP and had even more overlap. Presumably, because you believe it is better for the tasks. Similarly, Coffeescript authors believe that Coffeescript is better than Javascript -- even if there's less overlap.
- slouch 15y agoWill understanding the CoffeeScript syntax help me learn another programming language like JavaScript did?
- thenduks 15y agoSyntactically? No. Ideologically? Absolutely. Guess which is more valuable :)
- code_duck 15y agoI don't use JavaScript for anything for which I could have chosen PHP. Given that PHP runs in exactly 0 browsers, what do you mean? Few people are choosing server-side JavaScript over PHP, though it may happen occasionally.
- justinbaker 15y agoHow is other different from I don't use either?
- jashkenas 15y agoThis 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.
- grandalf 15y agoThis is a lame reason not to have tried it yet, but I need to first skim a short tutorial that shows how to integrate with jQuery and ideally also shows simple uses of Backbone and Underscore in coffeescript. BTW I love Backbone and Underscore and thanks to them (and also node) JS is actually more fun than ever.
- PetrolMan 15y agoI'm actually about to make a dip into using Backbone so I've been holding off on transitioning to CoffeeScript to limit my shock. I've played around with the editor at GitHub though and I really like how CoffeeScript reads. That being said, actually using it in the wild seems is road I'm not quite ready to cross yet.
- markkanof 15y agoI've started using Backbone.js in a very limited way for some of our existing apps. What I'm doing is just using views as a way to provide some structure to what is currently a mess of jQuery event bindings and DOM manipulation. So instead of have a Backbone view that gets configured with a template and passed a model to render, I just do some setup code in the initialize function and then use Backbone's event function to setup all my event bindings for different DOM events that will occur within the element that is the root of that particular view. This is working really well so far. It doesn't require completely rewriting the app to be a single-page client side heavy application, but does provide a significant amount of structure to the code making it much more manageable. It also lets me reuse some views (sort of like widgets) that were previously tied directly to specific elements in the DOM.
- 15y ago
- desireco42 15y agoI totally moved from JS to CS. I still do JS on projects that don't use it, but generally CS is the way to go and makes things super easy.
- minibikini 15y agoYes, all new code in CoffeeScript. I don't know why to use plain javascript.
- michaelchisari 15y agoI've added CoffeeScript support to the client-side of Appleseed, and I couldn't be happier. Building out the client-side framework used to be drudge work with Javascript, now I prefer it to server-side work (which is in PHP). It's amazing what a more concise and logical syntax can do. While I think the language isn't perfect, it does just enough clean up on Javascript to make a huge difference.
- BasDirks 15y agoI use it for both client- and server-side. Do not skip learning JavaScript before learning CoffeeScript, if only to be able to debug CoffeeScript. The JavaScript equivalent of a 1-line CoffeeScript function can be over 20 lines, not because CoffeeScript compiles into bloated JavaScript, but because it is very 'expressive'. A trivial example (ignore style), project euler problem 1: (x for x in [0..999] when x % 3 is 0 or x % 5 is 0).reduce (xs, x) -> xs + x
- mikemaccana 15y agoInitially, coming from a Python background, I looked at Coffeescript as a fix for all of JS's woes. In particular, I mistakenly though the fat arrow syntax would mean I never have to do any 'that = this' hacks again. In practice, though, I frequently need/want to call a method as a callback. And inside that function, I might want to get something from whatever initiated the callback, and save it to the object I'm a method of. Ie, I want to access both forms of 'this'. So I still need to do the ;that = this' hack, ugly as it may be. It would be super awesome if there was something that always referred to the topmost class object, and something else that always referred to the initiating object if one exists. That said, I still like Coffeescript, was surprised to see how much Brenden Eich likes and supports the project at JSConf, and wouldn't be surprised if they addressed niggles like this in future.
- jashkenas 15y agoDo you have an example of a real-world piece of code that wants to access both the lexical and dynamic "this" ... and isn't a jQuery callback?
- spicyj 15y agoWhat's wrong with jQuery callbacks? ;)
- jashkenas 15y agojQuery 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` // to still point at the AccountView instance. }); };
- electrichead 15y ago@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); });
- Siwy_ 15y agoI 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.
- mythz 15y agoTrying 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.
- Siwy_ 15y agoSo far I’ve been very happy with how the project is turning out and I already see a lot of productivity gains; there seems to be much less run/test/debug cycles. The tooling/intellisense is so much better than the plain JavaScript and a lot of the typos and errors are caught at the compile time. Plus, writing C# on client and server is such a nice change. Anyway, CS would be my second choice but that’s just because I work in .NET environment.
- nzoschke 15y agoI just did my first tiny project in coffeescript and found it to be an odd experience. I was far too aware that I was programming in tokens that needed to map to JavaScript. Far too often I had to go back to the interactive "Try CoffeeScript" form on the website to peck things into until the parser errors went away. To those more experienced: at some point does thinking in pure coffeescript take over, and the JavaScript transforms disappear? It is worth noting, my final coffeescript code is a thing of beauty!
- singlow 15y agoWhy not use the REPL for pecking things ? The need to do that for syntax issues has almost disappeared for me over the first few weeks of use, but I consider the REPL to be a valuable tool even after I am quite accustomed to any language.
- mrspeaker 15y agoYep - it goes away. When I started coffeescript I'd check the output of every statement I wrote (and had heaps of parser errors). Once I had a good idea of how it was being converted I stopped checking... I'm still not a fan of some of the output (I wouldn't write my JS like that, that's for sure!) but damn it's fun!
- krmmalik 15y agoThanks for creating the poll for me. I dont think i have enough karma to create a poll. There's no option on my login to be able to do that(?)
- pabloIMO 15y agoI use Coffeescript almost exclusively now. However, if someone told me that Coffeescript was going to vanish forever from tomorrow on, I don't think I would be heartbroken.
- huhtenberg 15y agoYou may want to add "What is CoffeeScript?" option.
- barnaby 15y agoI 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 fair, half of my company are on Ubuntu, but there's that 1/3 of the company on Windows that just can't practically work on coffeescript code).
- true_religion 15y agoThere'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.
- jannes 15y agoI 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?
- wvenable 15y agoYou can compile CoffeeScript's on Windows with this tool: https://github.com/alisey/CoffeeScript-Compiler-for-Windows 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.
- dualogy 15y agoYou're fully wrong. The CoffeeScript compiler is written in CoffeeScript and you find it in the extras/coffee-script.js JavaScript file. If you can load that in some JS runtime environment, no need for Node/NPM. Cygwin is the current way of "Node on Windows" but there will be much better / "more native" Node support for Windows coming in the next 4-20 months ;)) anyway, you don't need Node for Coffee. It only provides the Node integration pieces because the developer(s) do a lot of Node work themselves and it's a great way to write server-side code for Node for people coming from Python/Ruby etc.
- TrevorBurnham 15y agoIt's true that tools for compiling CoffeeScript on Windows are lacking, though the compiler runs fine in the browser as well as on Node—try it yourself at http://coffeescript.org—and http://coffeescript.org—and also in various JS runtimes for Java, .NET, and of course Ruby. If you're using CoffeeScript without Node, you're missing out. Fortunately, Cygwin-free Windows support is on the roadmap for Node 0.6.
- singlow 15y agoI've recently begun porting a small canvas game that I'd been working on into Coffeescript. It definitely helped me create cleaner code. Also using it on a real project and I was able to prototype the basic functionality a lot more quickly than when I was using pure JS.
- thiagofm 15y agoI think you guys obsess too much about programming languages. I doubt that anybody doing something useful cares about THAT "wohooo expressiveness". JS is alright, dammit. You don't need CS, you need to get your shit done.
- dualogy 15y agoI used to think like that. Then I found the next logical iteration from "just get it done" is "get more done faster with less code". Hence, CS works better than JS for getting that youknowwhat done.
- luismgz 15y agoAlright, I buy your argument. Now go and do everything in assembler, right now. Deadline is yesterday. What are you looking at?? Go!!!
- thiagofm 15y agoYou are exaggerating. Is it only me who likes JS better than CS? :( It's stylish.
- luismgz 15y agoNow seriously, it's not just the way it looks. If you never spent at least half an hour playing with a language such as python or ruby, you will probably never know what is it that makes programmers all warm and fussy about their languages. Just take a look at array comprehensions (or list comprehensions in python) to know how succint and powerful they are, and how much clear the code looks. It's about replacing four or more lines of js with just one, readable line of coffeescript (or python). It's all about power, flexibility, succintness and readability, all things that make programming more enjoyable and fun.
- pom 15y agoBut better expressiveness is exactly what you need to get your shit done. Being able to say what you mean concisely lets you focus on solving your problem and move on to the next task faster rather than getting bogged down into getting some petty details right.
- wheels 15y agoOne of the interesting things on doing some analytics on our customer base was seeing just how wide the gap is between the usual HN fare and reality: http://blog.directededge.com/2010/05/30/what-programming-languages-do-our-customers-use/ http://blog.directededge.com/2010/05/30/what-programming-lan... The core message being: things like Scala, Erlang, et al still represent a tiny portion of the actual tech world. (And our customers tend to be biased towards being techy anyway.) Just because CoffeeScript gets a lot of mentions in the ultra-early-adopter demographic doesn't mean that it's measurably popular yet.
- TrevorBurnham 15y agoThat shouldn't be surprising. A willingness to learn new and esoteric languages is one of the hallmarks of HN-ers. See also: The Python Paradox (http://www.paulgraham.com/pypar.html http://www.paulgraham.com/pypar.html).
- deleted 15y ago[deleted]
- cageface 15y agoThis is one of the reasons I've transferred most of my enthusiasm for new languages into new problem domains. I've been studying machine learning and DSP for most of the last year and it's done a lot more to revive my passion for programming than learning another new language could have.
- reinhardt 15y agoWish I could upvote you more than once. I find the language fetishism - especially for new/"hip"/esoteric languages - in HN and other geek echo chambers kinda annoying and, frankly, silly. There's only so many times one can express the same algorithm using basically different symbols until it gets old. Mastering new problem domains is a better time investment and more satisfactory than learning yet another way to write the Fibonacci function or a String class.
- icey 15y agoWhen 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.
- butu5 15y agoyou can try js2coffee which will convert all existing js file to coffee-script.
- mildweed 15y agoI see no need to convert my js to coffee just so I can compile it back to js.
- gavinlynch 15y agoagree. I've never really considered anything about Javascript's syntax to be cumbersome. I've written server-side Ruby and appreciate the syntax... But two points: 1) The syntax wasn't the only thing that drew me to Ruby. 2) I just don't see an any real need morph my JS code into a similar syntax. Writing JS is pretty easy.
- nicksergeant 15y agoFWIW, I used js2coffee on a 400-line JS file powering an app today and the compiled version of the code (js->coffee->js) was noticeably faster than the straight JS version. The for-in efficiency is probably part of that. A quick way to port once: http://ricostacruz.com/js2coffee/ http://ricostacruz.com/js2coffee/
- adrusi 15y agoI 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.
- bronson 15y agoIf your file is disorganized, I bet spaces and parentheses have very little to do with it.
- luismgz 15y agoYou can still use parenthesis if you find them more readable. Coffeescript won't complain.
- thenduks 15y agoIn what language do you routinely find 2000 lines files that are skimmable? Best to split it up logically, problem solved.
- stilist 15y agoAfter reading posts about it on here for maybe a year, I recently decided to try it for a small jQuery plugin. I enjoyed it so much that we immediately switched to writing all new code in CoffeeScript and have begun converting existing code as time allows. The benefits over straight JavaScript are amazing—I’d been writing careful code that drew from the ‘good parts’ mentality and pre-declared all variables, etc. Now I hardly ever have to worry about it. As I continue to write Rails code I wish I could skip commas in hashes. I didn’t really have an opinion on significant whitespace before (only briefly played with Python) but now I love it. It’s also the first time I’ve used splats, and I was delighted by the brevity it can achieve in combination with the erb-esque interpolation: http://cl.ly/2b371b380g3j071E2g0h http://cl.ly/2b371b380g3j071E2g0h The integration with docco has rewarded my habit of trying to write good documentation. I’ve tried to enforce a policy that any new CS must be documented.
- pavel_lishin 15y agoIs it difficult to debug the resulting code?
- michaelchisari 15y agoI might take this back later, but so far, not really. I thought it was going to be, I keep expecting to run into crazy debugging hurdles, but they just haven't showed up yet. Maybe I'm still at a naive point in my development, and just haven't done anything that would trip it up, but so far so good.
- jashkenas 15y agoBrowser implementors are working on making easier to debug all compile-to-JS languages, including regular minified JavaScript code. https://bugzilla.mozilla.org/show_bug.cgi?id=618650 https://bugzilla.mozilla.org/show_bug.cgi?id=618650 https://bugs.webkit.org/show_bug.cgi?id=30933 https://bugs.webkit.org/show_bug.cgi?id=30933 In the meantime, CoffeeScript tries to make debugging easy by compiling to straightforward, readable JS, with meaningful variable names, normal indentation, and all that. Patches to make the output clearer/cleaner for specific bits are always welcome.
- jorangreef 15y agoI have used Javascript exclusively on client and server since late 2008. First Rhino and then Node. Before that I used Rails. I can understand the syntax gripes that some people have towards Javascript but I think this has more to do with a Ruby notion of "elegance" coupled with a lack of familiarity with Javascript then it does with actual issues with Javascript. In fact, I prefer Javascript to Ruby. I have gone the whole way with Prototype and then the whole way back. These days I prefer using just 20 or so functional DOM helpers rather than Prototype's Element extensions or JQuery's wrappers. A handful of DOM functions are significantly faster. As a result I have found it useful to keep third party dependencies to a minimum. A minimum of zero is working well for me so far. Writing raw Javascript is refreshing, even if it means a "prototype" here or there. I have written many "var" statements and have yet to see an undeclared variable pollute the global scope. I write for loops often. Sometimes I use forEach or reverse while loops. I don't seen any need for Coffeescript enumerators. I keep checking up on Coffeescript from time to time but I prefer the explicit syntax of Javascript. After spending hours refactoring code the Rails way, I have come to prefer code that's big-O efficient, as fast as possible, as direct as possible, and if it takes a few lines less that's great.
- jashkenas 15y agoYou may have been misinformed -- the values of direct, raw, fast code are a big part of the reason why CoffeeScript works the way it does, and why many scripts can end up running faster after getting ported to CoffeeScript. The golden rule of CoffeeScript is to avoid adding any library code to the runtime, and to avoid introducing any special calls, to the greatest extent possible. Many folks rely on a "forEach" (or "each") iterator for all of their loops over arrays, because it's convenient. Unfortunately, it's also a very slow way to write an inner loop. CoffeeScript's comprehensions expand into regular JS loops over arrays and objects, so you get native speed, without the hassle. This: for item in list sum += item.amount Compiles into this JavaScript: var item, _i, _len; for (_i = 0, _len = list.length; _i < _len; _i++) { item = list[_i]; sum += item.amount; }
- augustl 15y agoI'd write that snippet the following way: for (var i = 0, ii = list.length; i < ii; i++) { sum += list[i].amount; } Or: for (var i = 0, ii = list.length; i < ii; i++) sum += list[i].amount; There are ways to make normal JavaScript not look ugly ;) EDIT: fixed minor oversight
- roder 15y agoSyncPad switched its webclient from JS to CoffeeScript. In terms of human-readable code, we reduced the lines of code by ~30%. It's cleaner and more concise. I feel our code is more managable because of CoffeeScript. In terms of the generated JS, I really appreciate that CoffeeScript creates an abstraction that will implement JS best practices and consistency At this point, any JS work I do is done with CoffeeScript
- bonzoesc 15y agoMy projects have been the same way; I spend less time writing "function" and more time making stuff happen.
- JesseAldridge 15y agoI think CoffeeScript looks quite cool, but I'm afraid introducing a compilation layer will complicate my life and lead to weird issues which will cancel out any productivity gains. And while Javascript may not be perfect, it's good enough to get the job done.
- luismgz 15y agoWhat's the problem with the extra compilation step? You can simple use coffeescript by adding "script type=text/coffeescript" tags to your code while developing, and when you are done, just compile and deploy. Or you can simply authomate the task (google for instructions).
- alnayyir 15y agoYeah, and what happens when it introduces a weird bug?
- thibaut_barrere 15y agoI suspect CoffeeScript will have a fairly high adoption on people that do use JavaScript only from times to times (like me).
- luismgz 15y agoDude, this poll is useless. If someone is voting here, chances are that he was looking for info on coffeescript, so he is already aware of this slanguage and is interest in it. The rest of mankind may not know wtf is coffeescript...
- pom 15y agoNo. Mostly because of the egregious use of significant whitespace :(
- deleted 15y ago[deleted]
- conorwade 15y agoI am moving to it. So far so good.
- rudenoise 15y agoAs a developer who really loves JS (not because of its syntax - which is fine - but because what I'm able to do with it) I just don't really get CS. I wan't to be able to debug the code I'm writing in the code I'm writing. The extra layer of sugar seems sickly sweet, nice for a taste but overpowering in bulk. I think I'm prone to wanting to go lower and seeing how things work in the layer beneath. I'm fascinated by C and assembly languages and how my JS ultimately sits on top of those. I think if CS was interpreted at the same level as JS I'd be more interested. I guess it really depends on how much you use JS and whether CS makes your work easier. I'm always looking at what complexity I can throw away, I think CS may be just that.
- tobylane 15y agoIt sounds such a simple change I don't feel the need to learn it, just to give myself a bit of time before I next plan to use javascript.
- Apocryphon 15y agoI'm currently learning JS, but am preferring to not learn CoffeeScript or jQuery yet, because I feel like I would be avoiding the nitty-gritty of the language with convenient frameworks that pave over some ugly spots. I know that JS is a bit of an aberration in that it has been around for so long in so many places yet has so many fundamental flaws, but it feels wrong that I would have to learn a framework that wraps around the language to protect me from the ugliness of the language. I'd rather face JavaScript full on first, suffer through the process, instead of jumping into CS. Also, I never understood why some people advocate learning C++ before C. But that's a different debate...
- michaelchisari 15y agoI don't recommend learning CS before JS, because it's a different interpretation of JS, it isn't its own language. In fact, I'm glad I boned up on my Javascript skills (read "The Good Parts" and some solid tutorials) before moving to CoffeeScript.
- seivan 15y agoUsing CoffeeScript and not looking back. class Awesome extend JavaScript
- dlsspy 15y agoCouchbase shipped coffeescript as an officially supported language for couchdb design documents (views, filters, show and list functions, etc...). I started using it when Jan committed that and have enjoyed it quite a bit since.
- mgan 15y agoAs I'm learning couchdb and plan to use it for a project, the coffeescript addition for map/reduce certainly gave me cause to look more closely at coffeescript
- hebejebelus 15y agoPrimarily I use GWT, but occaisionally I'll do some pure js just for fun. Coffeescript doesn't have any particular features that I need, and I'm perfectly happy using js.
- Malic 15y agoNo, I do not use CoffeeScript.
- rmason 15y agoWhat no JQuery option?
- TrevorBurnham 15y agoI'm the author of the PragProg book on CoffeeScript: http://pragprog.com/titles/tbcoffee/coffeescript http://pragprog.com/titles/tbcoffee/coffeescript It's heartening to see so many people responding to this poll. I hopped on the CoffeeScript bandwagon more than a year ago; a week of using it was enough to convince me to stop writing pure JS. It's become my favorite language, even overtaking Ruby. (Cue dhh at last month's RailsConf keynote: "Looking at CoffeeScript was the first time I got language envy.") These last six months have been amazing: In December, CoffeeScript hit 1.0. In April, it officially became a part of Rails. In May, Jeremy Ashkenas gave a talk alongside Brendan Eich at JSConf. That same month, the beta of my book was PragProg's #1 direct seller. So who knows what the next year holds for CoffeeScript? It's probably never going to take off in cubicle-land—and for that we should be grateful. But I would like to see it get more traction beyond the Ruby and Node.js worlds. (Pythonistas, represent!) And I'm sure we'll see far more high-profile projects written in it... and not just at 37signals. For web developers, JavaScript is where the action is right now. And CoffeeScript is, in my opinion, the best way to write JavaScript.
- deleted 15y ago[deleted]
- jasonporritt 15y agoI agree -- CoffeeScript is the best way to write JavaScript right now. I very recently had a great experience writing a mobile web application using it, and I'm pleased that it's now an official part of Rails. Like most languages at 1.0, though, it has some growing to do. I still find myself needing to dive down into the compiled JavaScript to make sure it's doing what I think it's doing in some unclear situations (nested data structures we used in our tests, for example). I've seldom found a need to take similar actions in more mature languages and I'm sure that will improve as CoffeeScript development continues. I warmly welcome any tool that makes my life as a developer easier or more enjoyable (CoffeeScript does both) and I hope its success continues to inspire the growth of client-side web development languages.
- sippndipp 15y agoYES! And we've never looked back. Indepth blogpost here: http://9elements.com/io/?p=551 http://9elements.com/io/?p=551
- mikegreenberg 15y agoIf you're interested in checking it out, there's a great ebook on github. https://github.com/autotelicum/Smooth-CoffeeScript https://github.com/autotelicum/Smooth-CoffeeScript
- code_duck 15y agoI'd like to use CoffeeScript. Since it's just dabbling, I haven't actually managed to install it. I got caught up on the whole 'watch out NPM is capable of hacking you be wary!' part of the node/coffee install process. Positive about it, though. I'll be using it in the future but not quite the 'next opportunity'.
- apostopher 15y agoyupp i have. coffeescript is gr8!
- glesperance 15y agoMoved back from coffee-script because event though all its syntactic sugar is really helpful to program faster, it seems to me that CS lacks clarity and still has too many ambiguities.
- chriserin 15y agoI love coffee script. With coffee script and backbone I've been able to take an extra step in creating manageable complexity on the client side. I was never the greatest javascript programmer, and coffeescript allows me to not worry about all the things that tripped me up (prototypical inheritance and all the different ways to implement classes/inheritance) and concentrate on the problems I'm trying to solve with a clear set of rules. Coffeescript curates the good parts of javascript for you and adds the syntactic sugar that cleans up the gnarliness of javascript.
- JiPi 15y agoIntending to use CoffeeScript really soon!
- tomkr 15y agoFunnily enough I started doing some stuff to in CoffeeScript for the first time today. So far it's been a lot of fun. As a Python guy, any language that has meaningful indentation gets a plus in my book. I'm still getting the hang of it, but so far I am considering switching heavily.
- chrisrb 15y agoAt HotelTonight we are 99% Coffeescript, including our "native" (Titanium) iPhone app.
- fibric 15y agoI never got my hands warm with JavaScript but CoffeeScript opened up a huge new world for me :)
- drivingmenuts 15y agoConsidering CoffeeScript
- runeb 15y agoUse both, but have a tendency to start new things in coffee
- chrisrb 15y agoAt HotelTonight we use CoffeeScript everywhere we'd normally use JavaCript. This includes our "native" (Titanium) iPhone app. Being a Ruby shop, CoffeeScript (CS) has been a choice for us. We simply find it is a good fit for our minds and how we like to write code, makes it that much easier to structure and organize code nicely, and is more pleasant to look at day in and day out.
- mattaus 15y agoYes I have, I'm even creating all my plugins in CoffeeScript from now one.
- veidr 15y agoLike many, I read about the cool kids using CoffeeScript for months before I finally tried it. (I mostly work with Objective-C native apps and Ruby backends, so I'm not a JavaScript programmer--more like a user. A web view needs to frob the DOM or do some AJAX or something.) A project came up where I needed to write the skeleton for a simple single-page web app component of a larger system. The window has a few panes which need to do AJAX, swap subviews in and out, and react to various inputs. Simple, but it has a few different view controllers and different kinds of data objects, so I decided to use this project to try CoffeeScript. Comapared with JS, CS is much more concise and instantly readable. I think basically everybody agrees about that. It makes even Ruby feel a bit clunky with all the extra typing. ;-) But surprisingly, there are no significant drawbacks. Debugging, the issue I had been wondering about, turned out to not actually be a problem at all. Two lines of CS code might be compiled to a sixteen lines of JS, but it's obvious what is going on, and debugging is effectively just as easy as ever. So, two weeks in, I am reasonably sure that I will never write in raw JavaScript again. I just can't imagine why I would ever again type "function() {" three times to write one spec, or write my own for loop just to iterate a collection, or spend my time mentally filtering out all those braces and semicolons. Granted, I am not mainly a JS coder, so my perspective is not the same as, say, a frontend dev to whom JS is second nature and 'the good parts' are deeply ingrained. My hunch is, though, that even if I was I would still switch. The end result is the same, but the process of reading (and writing) the code is much nicer.
- gotofritz 15y agoNo, I still use Java Script and not CoffeeScript I still don't see the bloody point.
- luismgz 15y agoI love cs with all my heart. It makes client-side programming fun and enjoyable. It made me forget my dream of having someday python running in the browser. Cs is just as good. My only criticism is that sometimes, leaving out parens mames the code hard to decipher. I feel that explicit parenthesis make everything clear, but that's probably because I come from python...
- TomK32 15y agofor new projects yes, haven't started migrating old stuff yet. Rails 3.1 will be when I migrate my client's javascript.
- TomK32 15y agofor new projects yes, haven't started migrating old stuff yet. Rails 3.1 will be when I migrate my client's javascript.