/ blog

Radiant JavaScript Singletons Freelance Down Under

28 February 2008 · Estimated reading time: 6 minutes

It’s summer down under and I’ve spent the last 2 weeks on a self-styled “working holiday,” freelancing doing some fun work with Radiant CMS and rediscovering the beauty of JavaScript prototypes. I’ve also managed to relax a bit, going to the beach and swimming with my beautiful daughters. Not a bad way to spend some time off work.

Let me apologise in advance. This blog post isn’t really about any particular topic. Or, at least, I didn’t think it through enough to find the theme. It’s more a series of points that, to me, hang together because they all relate to a slice of my time, but to you might make as much sense as a cauliflower sandwich.

  1. Freelancing, I’ve made as much in a week-and-a-half as I make in a month-and-a-half in my “real” job. Don’t get me wrong, real jobs have benefits, like predictability. (Good for raising a family, that.) But there’s something a little thrilling about invoicing someone for thousands of dollars after spending just a week on their project. I know the client is getting a good value, but a part of me still feels like I’m getting away with something.
  2. I’ve been lucky since I moved to New Zealand to have had the opportunity to really push my understanding of programming and software development in general and JavaScript, specifically. I feel like I’ve “grown up” career-wise in the last 10 months, going from talented amateur to confident professional in the process.
  3. I know now, better than ever, what I like to do. It’s pretty fun to design a database. It’s rewarding in a kind of brushing-your-teeth way to write the back-end plumbing for a dynamic site. I do enjoy solving usability problems employing user-centered analysis and design. But what really floats my boat is taking a complex graphic design and creating a correct, lightweight, standards-proud implementation of it. What makes me want to run, not walk, the dog and hurry through my bowl of cereal so I can get back as-fast-as-possible to Coda, is taking a set of design requirements and expressing it in HTML, CSS, and JavaScript in a way that is efficient and elegant and rock-solid across browsers and platforms. In short, it’s implementing the client-side experience that really makes my hair fly back (so to speak, since my hair is actually less than 1 cm long, not to mention thinning…).
  4. Over the last 3 months particularly, I have had the opportunity to really push myself as a programmer. It started with a 3 week stint in the Trade Me offices working up new GUI widgets for Travelbug. These included a sliding price selector, animated “last minute deals” calendar, and some other bits and bytes. It’s not often that you have the opportunity to do something over. With the last minute deals calendar, I had that chance. I had built a very similar (though a bit more complex) booking calendar for the original Travelbug launch and it was a monumental effort on my part. Blood, sweat, tears, the whole 9 yards. This time, it took far less effort, was far more organised, was far easier to tweak when the inevitable changes to the original requirements crept in, and was just plain more fun to build.
  5. Just this last week, I built a fading slideshow interface element for wapid! yeah, this kind of thing has been done 100 times and I probably could have found someone else’s component that would have done the job. But then I wouldn’t have experienced the joy of rediscovering prototypal object instances. You see, I’ve been way into the module pattern recently, to the point where I’ve been using it for pretty much everything. This slideshow widget showed me that it is sometimes not enough by itself. For this slideshow, I have multiple “campaigns” (sets of slides, basically) and a single viewport (and set of controls). I mean, it’s basic OOP, but isn’t it obvious that I would want multiple instances of a Campaign object and a singleton, basically, to control the viewport? The correct design is the design that seems obvious once it’s implemented. Anyway, have a look at the script itself (specifically WAPID.animation). It combines the module pattern with good old fashioned constructors and prototypes (implemented as private members). The result makes sense, at least to me, and just feels good to think about. It’s code that makes me smile.
  6. I was thinking today of taking up sculpting. I’ve always wanted to sculpt and, after skimming through some books at the library on gothic and baroque architecture and art, had an idea for how to approach it. I want to sculpt hands. I want to sculpt 100 hands. The first one doesn’t have to be any good at all. The second, either. By the time I have done 100 hands, I’ll have a good idea of whether I’m any good at sculpting. I’m sure I’ll be better at it than when I started, and I’ll have done something. Isn’t that what art is about, anyway?
  7. I really, really like having a pool. I know it’s a waste of resources. I picture some atoll in the Pacific sinking just a little further under water each time I run the filter overnight, but I have to say, it’s the most fun I’ve had with my kids ever. We get in the pool and it’s all splashing and laughing. They’re perfecting synchronised swimming routines. We’re all doing handstands and somersaults. It’s a blast. Keeping it up is a bit of work and expense, but I actually like doing the maintenance on it. There’s something Zen-like to the process of skimming the leaves off the surface and slowly running the vacuum over the pool floor. I never thought in a million years I’d have my own pool. Now I don’t ever want to be without one!

And so concludes my (to you) random collection of points about this little slice of life I call the last 2 weeks. We’re off to a bach in Pataua for the weekend for some family time. We’ll swim in the ocean, hunt for seashells, then it’s back to the real world come Monday.