Through achingly slow steps over the past …who knows… I have finally gotten myself to the point of writing some new code in an area I’ve wanted to explore for awhile. I want to create richer UIs for interacting with information, like the old days in a way that’s been lost to me since I took up living in HTML and architecting on the server side, mostly.
I want to draw shapes again. Interact with them and the data they model.
Searching for a way in…
I looked into Java for awhile, couldn’t believe the GUI hasn’t really progressed since Swing…really? It’s insane that it’s still so ugly and awkward and heavyweight. The Groovy folks have made the best of it with Griffon, but it’s still too heavy a framework for what I want. Processing is a fantastic garden for growing beautiful visuals and interaction, but I don’t want to create sketches in the Processing language separately. I want to integrate those capabilities into a little application code. I looked at calling Processing from Java as an API, but that’s a tough path, the too-thin part of the curve. I came back around to thinking I should ditch rich clients and build on the HTML Canvas element, or maybe SVG. I set aside SVG because it just didn’t convince me to dive in. I kept expecting someone to have already built the kind of GUI framework I wanted on the Canvas API, but couldn’t find it. I guess no one really does that anymore, or they’re doing it privately. So I looked more closely at the admirable John Resig‘s amazing port of the Processing language to Javascript (processing.js), and I began to see that it was pretty concrete stuff layered on top of the Canvas 2D API.
At a certain point, you just have to dive in and write.
After more crawling and struggling to dust off memory and limber old muscles I am finally at a small base camp from which I can incrementally add functionality. I’ve got structured code (JS functions and objects), interactive logging (writing to a DIV), debugger support (Firebug), decent editor support (IDEA 9), and DOM manipulation and event handling (jQuery). My rudimentary model of objects is drawn and events are noticed.
I do feel older, though.
I am guessing it’s been about 20 years, actually, since I dealt with this stuff. I know I was writing Think C code back in ’90 and ’91 that dealt with component hierarchies and their visual representations. I even remember some earlier GUI frameworks for DOS back in the late 80′s…yikes. Talk about feeling old. Things seem a lot richer and simpler now — no dealing with offscreen buffers, or invalidating portions of the view…I guess today’s machines are fast enough that you just draw what you’ve got as often as you need.
…and the creative energy still beckons.
What’s satisfying is that the code required to make what I want seems like it can be pretty small and clear, and Javascript offers enough dynamic language sweetness to keep it appealing. All this takes place in a browser that’s already running, and whatever happens there can be integrated with the rest of a very big wide world around it now.
I was standing in a Barnes & Noble earlier today, scanning row after row of books on platforms, languages, disciplines…all software and making it. Even after all these different roads I am still excited to feel the rush of all that thinking, all those people learning and following and inventing. And I’m thrilled to be able to dive in and muck around too.
Who knows what might come out?

Post a Comment