I’d begun to think that my programming days were over for good. Although I’ve never actually worked as a professional developer, I’ve written a few programs for money over the years (one was an MS-DOS emulator that wound up in the radio telephones they used while drilling the Channel Tunnel, another was a database of the world’s greatest ikat textiles, for a collector in New York). What I’ve done is learned and written about a lot of programming languages – 21 at the last count, many of them experimental, some of them frankly off-the-wall. But mostly I program just for pleasure, or to write small utilities I need – say, to change the phone codes again – or to implement some algorithm I’ve come across in my reading.
Finding a language nimble enough to fit this usage profile is becoming less easy. Once I used Forth, then Lisp, then Turbo Pascal, Delphi, Visual Basic and most recently Python. Several of these failed the transition to Windows, while others made it but grew bloated in the process. I need something small, fast to write and preferably interactive (Turbo Pascal compiled so fast and had an IDE that made it feel interactive, ditto with Visual Basic). I’m also overly fastidious about language features and syntax, almost to the point of obsessive/compulsive disease: I detest the syntax of C and C++ so much that I can’t bring myself to use languages like Java that imitate them. I’m deeply committed to both object-oriented and functional programming styles, and can’t get on with any language that doesn’t support lists.
Delphi and Visual Basic grew too bloated for me at about versions 3 and 4 respectively, but I was temporarily excited recently when Microsoft announced Visual Basic Express. I was going to install the version distributed with PC Pro, but I somehow never got round to it, and I haven’t felt motivated to pursue it further. Python entertained me for about a year, but I gradually started to become irritated by the Unix-ness of it, the messy installation and path handling, its 1970s TTY-ish I/O and lack of any sanitary interface to Windows. Around that time, after finishing a matrix arithmetic package in Python, I started to run out of things I wanted to program and even, whisper it low, became bored with programming itself.
Then something came along completely out of left-field that rejuvenated my flagging programmer’s taste buds or, to mix metaphors in a most perverse way, acted like programmer’s Viagra. That something, believe it or not, was Google SketchUp. As a simple 3D authoring package, SketchUp is quite outstanding: anyone can start to create 3D models within minutes without the horrendous navigation problems that usually beset such software. SketchUp’s clever inference engine second-guesses what you’re trying to achieve and saves you from flailing around along three different axes to place things where you want them. To be sure, it’s limited to largely rectilinear, building-shaped objects, but then it was intended for architects.
Very soon I’d created a 3D model of my Italian house, complete with surrounding terrain and trees, and rendered in surprisingly realistic stone and terracotta tile textures. It was while flying around this model that I noticed the fateful item on the Window menu called Ruby Console.
I selected it, instinctively typed in “2+2” to the blank window that opened, and very soon was hooked. I’d vaguely heard of the Ruby language, that it was an object-oriented scripting language something like Python, but mostly in the context of its web-authoring framework Ruby on Rails. It turns out that SketchUp includes a full implementation of Ruby as its scripting language, with an API that lets you into the very guts of the 3D engine. I use TextPad as my editor via a file I call scratchpad.rb that SketchUp loads automatically on startup.