Davyd Madeley and I gave a tutorial at linux.conf.au this year about the basics of writing GTK and GNOME applications. That’s hardly an original topic, but we set out to do it working in three different programming languages simultaneously, and that made it really rad, of course!
(Click through if you care to see the abstract for the talk)
So the obvious thesis for the tutorial was that it really doesn’t matter that much what language you choose to writing a GTK program in; in other words, pick something that you’re comfortable in and concentrate on getting your app built, but on the other hand once you’ve learned GTK, that knowledge will be pretty portable to other languages should you care to stretch a little and switch.
Of course, we had to figure out how to convey that message. The obvious thing would be to just do the same program three times, once in each language, but we figured that would be pretty boring and repetitive. So instead we decided to do one application, but start it in C, continue it in Java, and then complete it in Python. Whoa!
One thing that was cool (and really, the reason that I’m blogging), was how Davyd and I ended up preparing the slides. We’d been batting around these ideas for a while, but knew we’d need a day together to bang out the slides. So Davyd flew in to Sydney a bit early and we spent an afternoon doing what was, to all intents and purposes, pair programming. Only it was writing slides and doing images. So it was like, pair sliding. I’m a big believer in agile programming practices, but I’m always amazed when I see it work in a not-coding context. It was an awesome experience: we were doing images in Inkscape, one person driving, the other catching things and offering ideas and advice. The flow was unreal. For either one of us to do that one-at-a-time remotely would have taken forever and not come anywhere close to the same quality. Same with the presentation slides. The deck slid back and forth a bunch of times as someone would say, “nah, more like this” while the other person said “ok, sure, but try that“. Amazing.
Anyway, as it turned out, our tutorial ended up being less about language and a lot more about tying the essence of “graphical user interface programming the GTK way” together. We covered the basic concepts in C, and along the way fairly clearly pointed out that that much boiler plate coding by hand in C is kinda a pain in the ass because we were writing code, live, right there in front of people. Conventional wisdom about giving presentations would have it that that’s a pretty risqué thing to do, but it was a lot of fun and, I think, helped keep the pace of new material sane. With the foundation ideas covered, showing how they were implemented in (say) Java was not a big conceptual jump. Once we’d made the switch, we returned to discussing more GTK-isms, further driving home the point that language choice really isn’t the big question. Along the way I got to do some of that magic “java-gnome code madly appearing out of thin air in Eclipse” thing, which is always pretty impressive to see.
People seemed pretty happy with our presentation, and we’ve already have a few requests to give the tutorial again at other events, which definitely makes you feel good about yourself. Oh, for those who were there, slides are now up, as is the source code from the demo.
And to my partner-in-crime on this one: Davyd, thanks for your hard work!