Alex headshot

AlBlue’s Blog

Macs, Modularity and More

Apple gets it

2007, java, mac

Alex, Matt, Rick and Mike have lunch A week or two ago, I flew into Raleigh/Durham airport to meet up with the guys at JavaLobby (who also run EclipseZone and DZone). In the photo (from left to right) is me, Matt, Rick and Mike, who this week published a recent JavaLobby newsletter along the lines of a conversation that we'd had at the time.

In summary, the newsletter is a whine about the state of Java on Mac OS X. Apparently, because the iPhone doesn't support Java, developers are leaving the Mac in droves. I think reality is completely the opposite.

Firstly, Mac OS X is still the only OS where you have a guaranteed Java installed. Yes, some Linux distributions do (and maybe more with the OpenJDK in the future) but bar Solaris, it's in a league of its own.

Secondly, Mac OS X has always been a multi-lingual box. Applications can be scripted with AppleScript, they are written in Objective-C on Cocoa or in C on Carbon; and Python Ruby, and Perl are installed for your use. Claiming that developers will disappear just because your favourite language isn't supported is a bit naive.

Thirdly, Mac OS X users (and for that matter, business users in general) don't always up to the latest and greatest immediately. Frankly, there's still a lot of people on 1.4, and they probably won't move forward until it gets unsupported. Why? Because no-one really needs the feature bloat that's been put on Java for the last five years. Some of the VM/JIT stuff is nice, but it's really not worth having to update just because someone fancies using generics. In short, there's no really compelling case to move fowrards, and (bar security bugs) I'd prefer not to have to download another JVM every month as Sun pushes them out. Just give it to me when it's ready, and I'm happy with that. And, as the recent Safari debacle goes, it's worth nothing that 'previews' are exactly that; they're not something you should sensibly depend on.

He then goes on with a bit of hand-waving about how he's apparently ripped off because he can't get the latest from WWDC, despite not going, and then makes wild assumptions and accusations based on what might happen with Carbon. OK, so it's not going to be 64-bit; that much is obvious, given the legacy nature of the codebase. (Incidentally, this is why Objective-C wins as a framework; the underlying frameworks handle all that for you, and you don't need to care.) He doesn't seem to know that Tiger has had 64-bit support for those systems that have it (and by the way, Intel Core Duo is the 32-bit model; Intel Core 2 Duo is the 64-bit model, as are the Intel Xeons in the MacPro/XServe) which means that the OS can farm out memory to multiple 4Gb processes. Yes, each VM won't be able to handle more than that; but realistically, it's only high-end server machines that have that much memory; and they tend to be running more than one VM. In any case, the current Macs tend to max out at 16Mb currently (32Mb for the top of the line XServe) and the GC becomes a killer on uber-large JVM heaps; so running multiple VMs isn't that bad.

As for SWT, Apple's been very responsive towards getting SWT and RCP working, particularly over edge cases like WebStart. In fact, they've specifically included some fixes in the Java preview to solve those problems that will be live with Leopard, as anyone who monitors the Eclipse bug list will know.

Lastly, the rant ends with "I don't know Objective-C. Java is cool." Well, guess what; there's not many good Java apps for the Mac. (The only one I can think of is OpenOffice, and that kind of proves my point.) Realistically, Java apps on Mac look bad because the interface is Metal. Even if it's OS-emulating (like NetBeans), it's not quite right; icons in menus, underlines for accelerators etc. stick out like a sore thumb. In fact, it's pretty much only Eclipse that gets this right, and that's because it uses the native toolkit (via SWT) to render the views anyway; and the Eclipse team care about making it feel like a Mac application. The majority of Java developers don't; frankly, none of them know about the 'primary modifier' or 'secondary modifier' and just assume that the first one is ctrl all the time.

Objective-C, on the other hand, is an open system (and yes, gcc has built-in support for Objective-C). It's also making in-roads to Windows; Safari 3 uses CoreAnimation.dll and CoreFramework.dll which are the Windows equivalents of the Mac OS X frameworks by the same name. After all, you write your app to the framework, not to the OS. And the language has a bunch of features that Java doesn't -- the ability to send untyped messages, to extend functionality of already instantiated objects with new functionality at runtime; and the tools (like Interface Builder) are the epitome of separation of UI from code (one which most Java developers fail at).

Personally, I'm glad that Mike won't be developing on the Mac. It's clear that he hasn't got a clue about what makes the Mac so powerful, nor of the frameworks that support things like CoreAudio, CoreData, CoreVideo or even iChat Theater, and the sheer level of interoperability that that brings to the space. And as for keeping people in business; the OmniGroup seem to be doing well, and they've been at it since the NeXT days, not to mention Delicious Monster, where the first week of sales kept a company going for over half a year. Attention to detail is everything on a Mac application; with a Java app, you're lucky if the logo doesn't look pixelated. And for the times where I need to develop cross-platform solutions, I'll be basing my work on OSGi or RCP, which already have stable, native platforms to rely on.

Of course, you'll be able to look back at this in six months after the Apple iPhone has sold 25 million, or in six years when Apple has got 30% of the market place, and see who's right. I know who I'd place my money on.