A cup of CoffeeScript


I have an irrational fear of JavaScript.

When I started web development, to me JavaScript was nothing more than adding fancy twiddly-bits to pages and as such I ignored it, focussing instead on backend and diving head-first into C# and Asp.Net.  Meanwhile JavaScript has been growing, changing and being used in more and more scenarios (Node.Js scares the bejeebus out of me).  Everytime I look at it I’m overcome with messages of how most people merely hack with JavasScript and misuse it, but I don’t know where to begin on learning “the right way”.

So, me and JavaScript have happily ignored each other for years, until WebGL came on the scene – something I could not pass up.  Still, my irrational JavaScript demons would continue whispering to me.

Along came CoffeeScript to my rescue.  Looking at it I could see that it’s still JavaScript, still works in the same way, but most of the little bits I was afraid I’d mess up (and waste hours trying to un-mess) where abstracted away from me.  Also, as it’s still compiled down into JavaScript I could use it to work with WebGL.

In an attempt to learn CoffeeScript and WebGL together I am going to try and convert Giles’ excellent Learning WebGL Lessons to CoffeeScript.  I’ve got a repo set up on GitHub and so far have complete lesson 01.  I’m also hoping to get the lessons running on the GitHub Pages, but the .coffee files are sent with an incorrect MIME type and I have sent a request to GitHub for them to add it – we shall see if they do, otherwise I’ll compile them all the JavaScript for demo purposes, but it kind of misses the point…