Getting over the hump with Node
Thursday, January 12, 2012, at 03:48AM
By Eric Richardson
It can be funny learning a new language or framework sometimes—you know exactly what you want the code to do, but just completely lack the basics you need to be able to get started on your ideas.
I certainly remember feeling that way with my early experimentations in Ruby on Rails, almost exactly six years ago. It took several dives into projects before I came to terms with the fact that a) I hadn't bothered to actually learn Ruby first and b) that sometimes my ideas needed to give into doing things the framework's way instead of my own.
Over the last few months I've had that same experience with Node.js.
Node is an event-driven system for running Javascript code. It has very interesting applications in situations that involve large numbers of client connections, and is just generally a hot new piece of technology at the moment.
It's also Javascript, which I write every day.
How hard can it be, right?
Like usual, that attitude got me right into trouble. I didn't want to practice some "Hello world" examples or a simple server—I wanted to jump straight in and code a well-architected application, in this case one that would experiment with ideas in replacing the aging Shoutcast processes that serve up KPCC's live audio stream.
After several false starts, I finally talked myself into just simplifying and following one of the example scripts in TooTallNate's node-icecast-stack to get over the hump and get something running. The results can be found over on SCPR's Github account as StreamMachine, mainly in the form of a little test app that connects to our Shoutcast server on one end and offers up a matching listener on the other side.
It's simple and not exactly something that's imminently near any finish lines, but it's exactly the sort of thing to get that first step out of the way.