Sunday, March 16, 2008

I want my...I want my J..V..M...

That ain't workin...

I love the iPhone, and what an amazing platform for development! As soon as the SDK became available I downloaded it and started to peruse the online documentation. As usual the apple quality of documentation is superb, and the tool support is equally fabulous (if you use a mac :), the lack of interface builder support in the beta SDK notwithstanding. I even like the use of Objective-C, a language that Apple (and NeXT before it) has steadfastly remained loyal to for eons. In fact, as a former C programmer it was like slipping off my Java-esque plate mail and slipping on a favorite jacket, worn in places, but extremely comfortable to wear. But then, you discover why you stopped wearing it in the first place... its got a hole in both pockets, so all your loose change clatters to the floor or something equally heinous.

No, this isn't about to degenerate into an anti-C rant - I'm too much of a loyalist for that - but what did surprise me was that they didn't include garbage collection for their iPhone runtime environment. It's a feature they've recently begun to support in their Cocoa development for OS X, from 10.5 (Leopard) onwards, and gets rid of the need for the somewhat complex reference counting scheme that they've used to keep track of heap usage in previous versions. In an environment where they really do need to make efficient use of memory, you'd think that garbage collection would be a trade-off worth making - especially as many newer developers who haven't had to manage their own heap space will be flocking to this platform because it's damn cool! Yes, the tooling apple provide to detect memory leaks is excellent but thats not the point - why not eliminate the problem at source and institute a lightweight garbage collection scheme? It has certainly made me re-evaluate my initial "gotta build something for this device" rush of excitement, maybe I'm getting old but I just don't wanna bother hunting down memory leaks any more - I'd rather focus on solving real issues like the problems that surround the thing I'm going to build!

That's The Way You Do it...

Well, it seems that Sun has decided to build a JVM for the iPhone, using the various Java Micro Edition JSR's. That's good stuff as far as I'm concerned. While that Java platemail may be a little uncomfortable at times its nice to be wearing it when fate comes at you with an axe :) From a legal perspective I'm not sure HOW a JVM is gonna get past the fairly explicit wording of the Apple SDK licensing, but IANAL, I have high hopes. Clearly this will meet my curmudgeonly garbage collection needs, but they'll need to be clever to massage those vendor-independent API's in JME to support some of the as-yet unique features of the iPhone. What I don't want is basically another little box for writing bland-looking Swing apps on, IMHO it must follow the style, look and feel of the existing iPhone interface, anything else would be sacrilege!

Money For Nothin' and Yuh Chicks For Free

Whatever your choice of developmental poison, the iPhone is clearly big and getting bigger by the day. The fact that Apple are using iTunes as an exclusive distribution channel is *great* news for independents - your software will be on millions of desktops with little effort. The fact that you pay them a third of your profits (I believe) is well worth it! I just hope that something can be worked out so those cool iPhone based jars that i and others want to write will get the same status as native apps. I guess time will tell.

(with apologies to Dire Straits)


Post a Comment

<< Home