CoffeeScript
Private Members In CoffeeScript
I’m a big fan of CoffeeScript. I find it to be more expressive and less clunky than regular JavaScript, plus it makes it easier to extend objects and emphasises lambdas. However, CoffeeScript partially obscures the native closures in JavaScript and as a result makes it very difficult to use private variables and methods.
Classes, Inheritance And Mixins In JavaScript
JavaScript doesn’t have native support for classes. Functions can be used to simulate classes (somewhat), but in general JavaScript is a class-less language. Everything is an object. This makes inheritance particularly strange, since objects inherit from objects, not classes from classes as in languages like Ruby or Java.
Internal Classes In CoffeeScript
CoffeeScript provides us with a very nice syntax for creating classes.
Check if a variable is defined in CoffeeScript
In JavaScript it’s pretty common to check if a variable has been created. You would usually perform the check with the following code:
Debugging CoffeeScript Line-by-Line
One of the main arguments against using CoffeeScript is that of debugging. CoffeeScript is compiled down to JavaScript before being sent to the browser which means we can only debug the compiled JavaScript version of our code, not the original CoffeeScript. Until now, that is.
10 CoffeeScript Features You Might Not Know
This week I’ve spent some time researching different CoffeeScript resources to be used for training at a client. In the process I’ve discover a few CoffeeScript features that I didn’t know about or are not that well known.
Resources for Learning CoffeeScript
CoffeeScript is a little language that compiles down to JavaScript. I’m a big fan of JavaScript, but it’s definitely a very quirkly language. CoffeeScript eliminates some of those quirks and brings JavaScript’s syntax more in line with languages like Ruby and Python.
Using Spine.js mobile
For the past 3 weeks I’ve been working on a mobile website for a hybrid iPhone app. We were already using Spine.js – as I mentioned in a previous post – and therefore Spine.js mobile was an attractive choice for building the mobile part of our website.
Shared Examples with Jasmine
On my current project we’re doing quite a bit of JavaScript development using CoffeeScript and the Spine.js framework. Since we practice TDD we’re using Jasmine to drive all our CoffeeScript code and I’ve found it to be a great little framework.