Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.


Rails Duck
Rails Duck
8,545 Points

Ruby vs Coffeescript

What are the differences and similarities between Ruby and Coffeescript? What is an example of a complicated program written in Ruby compared to Coffeescript? Should I use Ruby or Coffeescript in my next project? If Coffeescript is the answer, is Coffeescript usable with Node.js, Express.js, Polymer.js, React.js, and other stuff? If Ruby is the answer, should I use Rails?


1 Answer

Kevin Korte
Kevin Korte
28,109 Points

There are no similarities between Ruby and Coffeescript. Coffeescript is a language that compiles into pure javascript. Coffescript is a little more elegent and shorter to write, and once ran through the coffeescript compiler, it will output as vanilla javascript, and that is the javascript your browser uses.

Coffeescript is (kinda) to javascript as Sass is to Css.

Ruby of course, is just Ruby.

You could also use coffeescript to write node.js code, as again, it just simply compiles down to the javascript.