A cup of CoffeeScript

Media_httpuploadwikim_jacjx

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…

F# Koans

This lazy Sunday afternoon I decided to spend an hour two working my way through the F# Koans project on Github.

As my functional knowledge is zero to none I found this exercise quite interesting – Pattern matching and Pipelining in particular.

I ran the Koans in VS2010 which comes shipped with F# and in order to get the project to compile I needed to remove and re-add the assembly Fsharp.Compiler.CodeDom so that it was referencing the 2.0.0.0 version.  I have created an issue on Github to alert the author of this.