November 12, 2011

never stop learning new things

I've been playing with a few new programming tools with an eye toward creating a modern modular control system for my railroad club. The major components in this effort are node.js, redis, and jQuery. As a traditional C programmer by day, this stuff is new and interesting.

The most interesting of these systems has been node.js, in that it allows a complete web server to created using server-side Javascript. The use of anonymous functions as continuations is new to me as a C-guy, but their power is not lost on me.

As a guy who used to write low-level Macintosh completion routines in assembly language, and is playing with Objective-C blocks, this new way of doing things feels really powerful. But after spending few evenings debugging a mysterious failure, I realized that there are more bumps in the road.

The most annoying bugs I've written in the last few days all relate accidentally assuming that I can "fall out" of a nested anonymous function into common error handling code. It caused my server to abruptly truncate responses to clients which caused silent failures.

Over the last few evenings, I've learn to love the WebKit debugger and Mozilla Firebug trying to figure out what the #$% was going on. I guess an experienced Java or Scheme programmer I wouldn't have written these bugs in the first place.

Anyway, it is still really fun to learn new ways of doing things.