RailsCasts Pro episodes are now free!

Learn more or hide this

Tim Sullivan's Profile

GitHub User: TimSullivan

Comments by Tim Sullivan

Avatar

Fantastic! This came just as I was scratching my head about a few things. I do have a couple of questions:

1) What happens in the case of duplicate files? For example, I have someFile.js in my app/assets/javascripts folder, and another one in app/assets/javascripts/subfolder -- are they both included, or just the first one on the path order?

2) What happens if I list a file in the manifest that is also included in the require_tree . list? For example, I have a JS file that I need to ensure it loads before anything else. I list it manually, right above the require_tree line; will that file then be included twice?

Avatar

Yes. The PeepCode screencast about CoffeeScript shows how to use it with Jasmine.

Avatar

This screencast mostly shows how to transition from JavaScript to CoffeeScript. However, CoffeeScript adds a ton of really helpful constructs beyond that which JS provides, cleanly and easily.

The thing I've found best about it is that it brings language features that I use all the time in Ruby (like unless, string interpolation using #{}, improved looping, etc.) ...Mix that all in with the fact that it's more readable and uses fewer characters, well, you have a giant win.

We live in a world where web development requires some fluency in multiple languages: HTML, CSS, JavaScript, Ruby, YAML. Providing ways to simplify (SCSS being identical to CSS, but adding new abilities that are easy to pick up and understand, for example) is key to speeding up development. CoffeeScript takes some getting used to, sure, but in the longer term it'll make more readable, easier to maintain and more enjoyable to write code.