Friday, January 20, 2012

Clyde: Rebuilding Archaeopteryx in CoffeeScript (And Fuck Hacking Fuck Yeah Hacking)

I'm creating videos for a new business I'm launching soon, a business along the lines of PeepCode, Destroy All Software, and Railscasts Pro. This week I made one which explains the absolute basics of how to make music with Node.js.



Some time last year I made plans with Manning to put out a book on how to hack music via programming languages, but I cancelled the project because I just didn't enjoy the traditional publishing process. I'm creating videos instead now. The first is in post-production; I'm adding a bunch of animation and simple effects to make it very, very easy to understand, and also easy to follow whether you're on an iPad, an iPhone, a computer, or an Apple TV (or similar). The next videos in this series will be a video on how to write a drum machine using well-tested CoffeeScript, and another which explains how to imbue your drum machine with probability matrix intelligence. I'll be rebuilding Archaeopteryx in CoffeeScript.

I'm calling my Archaeopteryx clone Clyde, after the great drummer Clyde Stubblefield -- known worldwide to fans of funk and hip-hop as the "Funky Drummer" from James Brown's track of the same name, believed to be the world's most sampled record -- because Archaeopteryx turned out to be a really complicated name for most people to pronounce. Clyde is a much easier name to remember.

Some people also found the code in Archaeopteryx confusing. This is because I built it without tests, to my eternal shame, and also because I didn't really understand what I needed the code to do until I had built it. I'm happy to say that so far, the code for Clyde is more succinct, and much easier to understand, than the code for the original Archaeopteryx. This is partly because of the excellent open source ecology around CoffeeScript and JavaScript, including some terrific TDD/BDD options.

After the rebuild is complete, I'll follow up with a video (or short series) where I build a Backbone application around the code. It won't be a web page which autogenerates sound. Instead, this application will combine Backbone's excellent, simple MVC with Clyde's breakbeat-generating engine to output original sheet music. I actually got the idea for this one because I'm learning the drums and I needed more varied breakbeats to practice with; this solves that problem, and also gives me a good way to teach how to use Backbone.

It's important to have complex examples, I think, because as I build this stuff, my videos are going to explain serious techniques that anybody who works with these technologies will need to master -- things like package management, TDD, and namespacing. The goal here is not just entertainment. The goal is to enhance education by making it more fun.

Studies have found that the Daily Show incorporates more information than "real" news shows, and that people who watch it end up better informed than watchers of "real" news shows.



My personal theory is that this happens because people learn more effectively when they're having fun. If you're familiar with Kathy Sierra's Head First series of books, you know there's a lot of research out there which validates this.



Because of this, I have some plans for later videos which will turn out utterly amazing if they work, but for now I'm hard at work creating more videos, so stay tuned.

Also, a note about the name.

I had planned to call my new business Fuck Yeah Hacking, but on Twitter, LA Rubyist Judson Lester pointed out that this is very similar to Zed Shaw's Programming, Motherfucker. In fact, it's too similar. People have already asked me once or twice if I was just a pseudonym for Zed Shaw, or vice versa. We are in fact different people.



I hadn't intended it like this, but "Fuck Yeah Hacking" was actually a pretty derivative name. The attitude rips off Zed, and the naming convention comes from Tumblr, where there are a staggering number of fuckyeah[whatever].tumblr.com tumblogs, including fuck yeah wolves, fuck yeah alexis krauss, and fuck yeah bowties. It's basically an entire genre. That makes Fuck Yeah Hacking doubly derivative, and that's just weak.

So it's gone.

Here's an ad for the first video, which deconstructs an excellent CSS3 animation. It's still got "Fuck Yeah Hacking" in the name, but I'm too busy to fix it right now.



This one's good, but the next one's going to be awesome.