This episode of Herding Code the guys talk to Trevor Burnham about Coffeescript, “a little language that compiles into JavaScript.”
- Kevin asks Trevor to explain what CoffeeScript is. Trevor explains how CoffeeScript helps you to write the same code you would have in JavaScript, but more quickly and with less effort.
- Kevin ask if people like CoffeeScript because they hate Javascript. Trevor talks about the strong reactions people had to the addition of CoffeeScript support for Rails, and how CoffeeScript is not a dumbed down Javascript, it’s really just a cleaner syntax for exposing the functional power in the that underlies Javascript.
- Scott K talks about the time and political pressures that shaped Javascript, in some ways hiding a powerful language behind a mandated Java-like syntax.
- Kevin asks about the language inspirations behind CoffeeScript. Trevor talks about how it’s drawn inspiration from Ruby, Python, Haskell, and Erlang.
- Jon asks about how CoffeeScript support is technically added to Rails – where is the compilation happening? Trevor explains how the coffee-script and execjs gems select the Javascript runtime.
- Jon asks a question from Twitter by @darrencauthon about using CoffeeScript on Windows and .NET.
- Scott K asks about other languages that compile down to Javascript, and what will happen when Javascript as a language. Trevor talks about Objective-J and Traceur.
- Kevin asks about how you can debug CoffeeScript code.
- Jon talks about the Try CoffeeScript interactive compiler on the CoffeeScript.org site and asks resources for learning more about CoffeeScript.
- Scott K asks if CoffeeScript leverages more advanced Javascript features if they’re available, and if there are language facilities for extending the language. Trevor talks about how CoffeeScript is just Javascript, so you can leverage the extensibility features that are already available in Javascript.
- Kevin drops back to asking some basics: why is CoffeeScript so special? What’s with the new function syntax?
- Jon talks about how nice it is to just delete parentheses, braces, and semicolons. Trevor talks about how in general CoffeeScript code is 2/3 as verbose as the equivalent Javascript code.
- K Scott asks about how CoffeeScript simplifies scope issues, and Trevor talks about how CoffeeScript is very opinionated about scoping.
- Scott K asks about type coercion. Trevor mentions the wtfjs.com site, talking about how Javascript’s type coercion can be surprising at times.
- Scott K asks about how DOM manipulation is handled. Trever explains that CoffeeScript works great with jQuery, and any other Javascript library available.
- Jon asks if it’s possible to do CoffeeScript compilation in the browser, and asks if that’s possible / practical for standard applications.
- Jon mentions the SassAndCoffee project for .NET.
- Jon asks if there are any Javascript to CoffeeScript converters. Trevor says he doubts there will ever be a good one, but after the show sent Jon a link to js2coffee (link below).
- Scott K asks about JSLint support. Trevor talks about how CoffeeScript works with JavaScript Lint.
- Kevin asks if CoffeeScript has been used as a DSL, and Trevor mentions CoffeeKup.
- Jon asks what happens if CoffeeScript hits a compiler error.
- Kevin asks about split between front-end vs. back-end use for CoffeeScript.
- Jon some a question from Christopher Deutsch (@cdeutsch) about how to sell CoffeeScript to a team – is this today’s flavor, tomorrow’s legacy headache?
- Kevin talks about how he likes the => function, and Jon mentions how he likes the @ operator as well.
- Kevin asks about the object orientation features in CoffeeScript, and Trevor mentions how the class keyword is used.
- Jon says the he sees a lot of similarity between CoffeeScript and SASS. Trevor talks about how both reduce repetitions.
- Jon asks if jQuery could take advantage of CoffeeScript.
- Trevor mentions how you can buy his book and mentions a recent article he published in PragPub.
- Trevor’s upcoming talks: O’Reilly Web 2.0 Expo in NYC in October and Oredev in Sweden in November.
Show Links:
- Trevor Burnham (Site, @coffeescript, @trevorburnham)
- CoffeeScript site
- Hacker News: Rails 3.1 shipping with CoffeeScript
- StackOverflow: CoffeeScript on Windows
- StackOverflow: How can I compile CoffeeScript from .NET?
- Objective-J
- Traceur
- GWT (Google Web Toolkit)
- The CoffeeScript Wiki
- List of languages that compile to JS
- RailsCast: CoffeeScript Basics
- PeepCode: Meet CoffeeScript
- Trevor’s book: CoffeeScript: Accelerated JavaScript Development (Amazon, direct from PragProg)
- wftjs.com
- js2coffee (Javascript to CoffeeScript compiler)
- MiddleMan.rb –Â Middleman is a static site renderer that provides all the conveniences of a modern web stack, like Ruby on Rails, while remaining focused on building the fastest, most-professional sites possible
- SassAndCoffee: project, NuGet
- JavaScript Lint
- CoffeeKup
- Sass
- PragPub: A CoffeeScript Intervention
- O’Reilly Web 2.0 Expo in NYC in October
- Oredev in Sweden in November
Download / Listen:
[audio://herdingcode.com/wp-content/uploads/HerdingCode-0114-Trevor-Burnham-on-CoffeeScript.mp3]