I have recently rediscovered the joy of programming in Java for desktop Applications. Mac OS X provides a perfect deployment system for Java applications since Java 1.6 comes standard, so you don’t have to worry about directing your users to download Java for your applications to work. What’s more, since your application is written in Java it can easily be adapted (and perhaps unchanged) to run on Windows and Linux. So what is so great about Java:
- It is multi-threaded from the ground up.
Although threads can be used in many other programming languages, Java presents by far the cleanest and complete implementation I have ever come across. The language is built for threads at its very core with locking and monitor capability on any object.
- Namespaces and packaging
Between Java’s rich namespace support and it’s native packaging JAR format Java allows you to build applications component by component with minimal hassle when it comes to putting the components together. Unlike interpreted languages like Ruby, Python, and PHP, you are able to build your sky-scraper of an application without worrying about the size of it affective the speed of it. When you’ve completed a library, you can package it up an wrap it in a bow and feel confident that this component will serve you well for many projects to come.
- Garbage Collection
Most of the time, honestly, I don’t want to have to worry about mundane details like deleting objects that are no longer being used. Garbage collection does add a bit of overhead to an application, but it is well worth it 99% of the time.
Say what you will about Swing, but it still stands up as one of the most powerful and portable GUI toolkits available on any platform. With only a few lines of code you can have yourself a full-fledged application with the look and feel of the native operating system, and have it run on Mac, Windows, and Linux without the need for any form of recompiling. It gives you the building blocks that you need to have a rich application, and allows you to extend quite far also.
There have been some troubling trends over the past few years as they pertain to Java. New dynamic languages like Python and Ruby have gained a lot of attention at the expense of Java. Windows has stopped shipping with Java and the IPhone and IPad don’t support Java and likely never will. My website stats indicate that only about 85% of Windows user have Java installed – this is definitely less than 10 years ago when virtually all Windows machines were equipped with Java. If you do a Google search for “Java OS X” or “Java for Mac Desktop Apps” you’ll find a plethora of articles circa 2002. There is scarcely anyone talking about using Java on the Desktop in the past 3 years. Has everything worth writing been written, or is this just the writing on the wall.
I hope this does not foreshadow and end to the glory days of Java as a development platform on OS X. It would be tragic if, one day, Apple decided to leave Java out of the default install. That would force users to install Java before running any software dependent upon Java – which would make Java a much less attractive platform to develop on.