Java Strikes Back

Wed, 09/05/2007 - 09:02

Hot on the heels of Silverlight (perhaps too close to avoid calls of 'catch-up') comes JavaFX, Sun's answer to Flash and like (and hopefully solution to some of the joys of J2ME). One does, however, wonder if they've heard of brand dilution.

Unlike J2ME, however, this isn't Java but the scripting language formerly known as F3. However, the mobile part appears to be OEM-only, so we'll have to wait and see if it appears on many devices.

In other Java news, Sun are apparently starting to take the desktop seriously. There are good reasons why Swing hasn't done well: it has a steep learning curve and requires the threading of all but trivial tasks to get good performance, and in the past platform fidelity has been rubbish (the GTK+ theme is still extremely dodgy). Java 6 resolves most of the fidelity problem, and JSRs 295 and 296 should resolve some of the former. Of course, this still leaves the widespread belief that Java is rubbish on the desktop, which may be the hardest bit to overcome. All the more reason to ensure that your Swing application integrates with the desktop and thus that the user doesn't know (or care) what powers it.

Why C# is better than Java....

Submitted by Oliver Jones (not verified) on Tue, 12/06/2007 - 16:16.
If you're targeting Windows clients C# is a better choice than Java. Why? Because you can access the Win32 API. Sure that is in direct contradiction of one of Java's design goals but it sure as hell makes taking advantage of platform specific stuff a hell of a lot easier. Over the last 9 months I've been pretty much coding in C# exclusively (with a little C/C++ here and there). Having done a fair bunch of coding in Java I find the languages very similar in both syntax and feature set. But one place I find that C# better though is integration with "native" code. The P/Invoke system in C# is brain dead simple to use and works extremely well with minimal performance overhead (when not abused). C# is of course not perfect. The Windows Forms part of the library is brain dead and severely deficient when compared to Swing, and in many places just plain broken. But that is mainly due to it being built around the Win32 Common Control DLL which is horrible legacy stuff. .Net 3.0 and WPF look much nicer. My only hesitation to recommending C# more widely would be the fact that it is so heavily Microsoft Centric. Thank your deity of choice for Mono. One day I must get around to playing with that.

Can't quibble

Submitted by James on Wed, 13/06/2007 - 09:13.

I fondly remember writing JNI code for system tray integration for the very first Swing project I ever worked on. I'd have to therefore concede the point - and it is still, over six years later, unacceptably hard to get a Swing application transparently integrated into the desktop of your choice.

I'm currently playing with Objective-C again - even less cross-platform than C#, but rather neat, with both the blessing and curse of being able to be mixed with C. XCode isn't a patch on IntelliJ though.