Friday, May 29, 2009

Tales of C# Programming for Win32 Beta APIs, Part 1

Many, many people ask me what, exactly, my job is. I work for the Centre for Media Design basically doing whatever my supervisor wants me to do, and my current project is to develop an interactive data visualisation graph utilising information from a database of attendees of the IDMAA conference, being held here in August. This project has had a massive learning curve for me due to the fact that it is in a language I'm unfamiliar with (C#), using an API I'm unfamiliar with (Microsoft WPF/Surface) and with little to no documentation (the Microsoft surface is a brand-new piece of hardware and there isn't even a book written about it yet). Fortunately someone who is a significantly better programmer than me is assisting, and so far we've managed to hack out a pretty impressive looking demo.

One of the major issues with the Microsoft API is, predictably, how non-transparent it is. It appears that everything is designed to be tied directly into the XAML (the MS XML junk that describes the objects you're working with), making the C# clunky and difficult to follow at points (where do these freaking event handlers come from? why do you add them the way you do? no one knows). Threading was another delightful adventure into "wtf..." land; apparently, you cannot access an object inside of a thread unless it was created within that thread. Sure, this helps prevent synchronisation problems, but it's like cutting off your arm so you won't be tempted to reach for that last doughnut. Another major annoyance: drag and drop functionality isn't really "built in"...if you want to implement drag and drop, there's a rather long, detailed tutorial on the topic. Which is extremely useful considering the hardware is a touch surface.

Regardless, the project is going extremely well and I'm enjoying the challenge quite a bit. Once the project is finished it should be fairly impressive, if it's done right. Beyond that, the challenge will simply be to make it engaging enough for users, so we don't run into a trend of people getting bored with it almost immediately. That opens up the possibility of designing in some rudimentary game elements, maybe allowing users to "collect" interesting data, or garner points for connections, things of that nature. More on that as the project expands!

No comments: