Problem with static inheritance in CoffeeScript (and JavaScript)

Some time in 2013 as I was working through some JavaScript constructor inheritance tests, I found an example of static inheritance as an anti-pattern (meaning don't bother with it) in the transpiled code from a CoffeeScript tutorial.

The example is taken from Programming in CoffeeScript by Mark Bates, Addison-Wesley, pp. 147-150, where the author shows that CoffeeScript does not support static inheritance through the __super__ keyword.

However, the example contains more fundamental problems NOT specific to CoffeeScript, as I'll show with my own constructor.js examples.

Read More

Build your own TDD boilerplate project for JavaScript

Getting started with tests takes time because there are many small decisions to make. If you haven't gone through the whole setup and evolution more than once or twice, it's easy to get lost or just plain forget.

This post aims to walk through the creation of a TDD boilerplate project for re-use when driving your JavaScript tests. We'll set up the project to work with GitHub, node.js, mocha, rawgit, testem and travis. All steps were re-learned the hard way while I worked through my own where.js project in January-February 2014.

Special thanks to these wonderful people for their patient attention to detail and their marvelous feedback

Update: 25 NOV 2014 ~ links to rawgithub have been modified to point to the rawgit.com domain.

Read More