Dusting off the C skills (the Yaroze code lives)
Tuesday December 30th 2008
So frighteningly the end of another year is upon us. Where do they go? Still what better way to start 2009 than with a burst of learning some new skills (or even re-learning some old ones), and moving my development focus in a new direction.
A couple of different things have happened recently which have brought about this post. The first one has been a few emails from people asking about the source code for my Net Yaroze game, A Dog Tale, after a video of it was posted to YouTube.
Incidentally, while I’m talking about A Dog Tale, even more bizarre and obscure than somebody posting a video of the game to YouTube, somebody also sent me a link to a Wikipedia page about it. Blimey, does old code never die?
The second thing was me actually catching a whiff of free time over the holidays to actually look into picking up Objective-C and doing some Cocoa development on my Mac. Not that I’m complaining about being busy, but sometimes it’s good to be able to sit back with your feet up on the desk and take a breather.
Having had a Mac since the late 1990s (A Dog Tale was developed on a Mac) I’ve long been interested in doing Mac development, but just never really got around to it. I had a dabble with RealBasic a few years ago, but didn’t take to it too much.
So why now? Well being freelance I have the luxury of taking myself in whichever direction I think would be useful/beneficial, and with Macs being more popular now than ever, now seems like as good a time as ever. Particularly with the rise of the iPod Touch and iPhone.
Having actually spent quite a bit of time writing C code during the late 1990s moving into Objective-C shouldn’t be too big a deal, except that my C skills are, well shall we say, somewhat rusty – in fact it would be fair to say that they resemble something close to a 1970s Datsun that’s been washed with salt water everyday for the last thirty years.
So while I was tidying up and sorting though one of my many many hard disks, I found all my old Net Yaroze source code. All written in C, using the Sony Playstation Libraries.
Looking back over it, it doesn’t actually seem as complicated as I remember it being, which in terms of moving to Objective-C is a boon.
To be honest, I think the fact that I’ve spent a lot of the past year working a lot with PHP and JavaScript (you just gotta love MooTools), is also a bonus as the syntax is similar to C.
So if you’re interested in looking over the Yaroze source, including the all the files needed to upload and run A Dog Tale, you can download it all here in one handy zip file. Download Net Yaroze Source
Also available is a basic tutorial on how to display sprites on the Net Yaroze. If you’re remotely interested in a tutorial I wrote 12 years ago, then go ahead and knock yourself out. Download Net Yaroze Sprite How To
So, after looking through all the old code, I picked up a copy of Cocoa Programming For Mac OS X by Aaron Hillegass, which is widely regarded as one of the best books to start with. I also browsed through the Cocoa and Objective-C documentation on the Apple website, of which there is plenty.
A couple of days in and much studying later, I have to say that after getting my head around the differences, it’s going well. All manner of stuff that Visual Basic programmers (something I have been doing for many years) don’t need to bother themselves with is flooding back into my head.
There are many comparisons across the web between Xcode and Visual Studio (and developing for Mac vs Windows), which from what I’ve seen so far are always biased one way or the other.
My attitude is that there are different horses for different courses. Sure they’re different, and personal preference does play some small part. Is one better or worse than the other? I’ve got some early thoughts on it but will reserve judgement until I get my head fully around what I’m doing.
Anyway, I’m going to plug on with the Objective-C work, and in the next week or so I’m planning to write another post aimed at other Visual Basic developers who are also looking to switch and to offer a simple comparison of an Hello World app.