Skip navigation

campbell

June 2003 Previous month Next month

[This entry was also written sometime last week...]

I rambled through my last entry, so this time I'll try to stay on topic. And what's the topic, you ask? Good question, I'm not quite sure, but I'll figure it out soon. Hmmmm. Did you see the Giants game last night? Yep, pretty exciting. Yep. Hmmmm. Nice weather, eh? Sure is.

Ahh yes, I've been thinking a lot lately about the state of application programming and the magic of well-designed, reusable components. The Java world has come a long way in the past few years in this respect. Just take a look projects like Jakarta Commons and Hibernate, to name just a couple. The open source community is finally starting to build on top of itself, and we're starting to see some real innovation as a result.

I remember when everybody and their brother would implement their own Base64 codecs, and now so many of these mundane tasks are handled by the Commons project. I remember when JDBC was considered a high-level library for accessing databases, and now we have these great really-high-level frameworks like Hibernate and JDO. I remember my first experience spending hours with DOM APIs to pluck objects out of an XML document, and now I could use JAXB in about 20 minutes to achieve the same effect. Sure, many of these libraries aren't part of the core JDK, but over time we've come to trust and use them as we do for say, the core Collections classes.

Over the past few months I've been hacking away at the Mu project while also helping out Paul Noffke with his novel tRioproject. We were sharing ideas on how best to implement pluggable audio sequencer and content hierarchy frameworks, and it became apparent that we could be sharing libraries, not just ideas. Going further, I was thinking that we could share the same content interfaces and data structures with Reed Esau's cool JReceiver project. It wasn't necessarily obvious (see the recent Ken Arnold interview) when each of us was designing our applications that we could be breaking these modules off into their own reusable libraries, but one could quickly see the benefits of such a collaboration. In fact, one of the next things I'd like to tackle is to break out some of these modules into libraries that we or anyone else out there could use in their media-based applications.

We as developers need to think less about writing monolithic applications. It should be more like putting a jigsaw puzzle together, where the pieces are things like reusable libraries and remote web services. Invariably, when you're putting a puzzle together, there are one or two pieces missing. Resist the urge to just shove the piece of gum you've been chewing for the past four hours into the hole. Sure it might fill the gap, but it probably looks quite poor in comparison to the rest of the puzzle. Also, it's no fun scraping old gum off a table. Yuck. Spend the extra effort, even if it doubles your development cycle, writing a small library. Chances are, someone else out there (perhaps even you a few months later) will find the library useful and will really appreciate the savings in their development cycle.

On a related note, I'd like to see a report on the amount of time people spend wrangling with native GUI, I/O, and networking interfaces when writing applications for a specific platform. Apple has spent many person-years developing iTunes in Objective-C and Cocoa (I'm guessing), and meanwhile Microsoft has spent similar number of person-years developing their Media Player using whatever, C++ and MFC I assume. In the end, both apps serve essentially the same purpose, but are only useful to the folks that own each respective operating system... I just performed a cursory experiment on freshmeat.net and found three dozen or so implementations of the game of chess. Written in Lisp, written in Perl, written in Java, written in C, this one uses GTK+, another uses Qt, and the list goes on. I guess the point I'm getting at is: how much time have we as an industry wasted over the years reinventing the wheel, writing redundant libraries and applications for every quirky platform under the sun (no pun intended)?

Let's instead focus our efforts on new applications that make people's lives better or easier in some way. Take something like Hydra, which Daniel Steinberg mentioned in a recent entry. This is an amazing piece of software that really changes the way you think about collaborative editing. And yet, only 4% of the computing world's population can leverage this innovation because it was designed specifically for Mac OS X. Don't get me wrong, I love my PowerBook, and this app's Aquafied interface is beautiful and usable. But we need to think about developing for people, not for your favorite UI toolkit or the programming language flavor of the week. [I'll spare you the Java evangelism, as I'm sure you could see where this point was heading...]

I believe it was Bill Joy (or someone similar in the League of Outspoken Smart People) who said something like "I'd rather have well-debugged binaries than open source code, any day". I like to think both concepts go skipping through the prairies hand in hand. Reusable binaries make constructing varied, complex applications a relatively simple process. Open source collaboration allows those binaries to be developed taking into account the feedback from other possible consumers of your technology. It shouldn't be an either-or scenario.

The things I've discussed here shouldn't be news to anyone, these are the fundamentals they teach you in Software Engineering 101. But sometimes it helps to remind ourselves that innovation is always within reach. Spend the extra cycles to design solid building blocks. If your structure should be dismantled someday, at least you or someone else could reuse the construction materials (okay, okay, I suck at analogies). Anyway, here's a simple test: if you find yourself writing an application and you're thinking about naming it "Yet Another So And So", you've failed, go innovate elsewhere. Otherwise, the community awaits your creation; why not host your project here on java.net for everyone to see?

[And what does any of this have to do with Java 2D, you might ask? Not a whole lot; I do have an interest in open source development, and it's just some stuff that's been weighing on my mind for a long time. But man, this was a rather bookish (i.e. not very fun) entry on my part. Maybe next time I'll give an update on what's happening these days in Java 2D Land.]

In my ears: "The Grand Hour", Guided By Voices
In my eyes: "Breakfast of Champions", Kurt Vonnegut

[We had some difficulty setting up my blog account; this entry was actually written early last week...]

This is my first-ever blog. Yep, I'm selling out to the blog gods, even though I once said I would never blog. I even gave up writing in my own journal a couple years back once I realized that each entry sounded exactly like the last - a basic recap of the days events and nothing further. So if my blogging devolves into a similar style, I'll give it up. But for now, I think these weblogs give us a chance to have more "face time" with the community. Many developers have complained that Sun isn't open enough, and I'd really like to dispell that myth by offering some news and thoughts from the inside. Making Java better is a community effort, and we're just one small part of that community. Hopefully you'll come to understand that the folks in the Java Client Group really (really really) care deeply about the concerns of all our customers, and we all really want to see Java succeed everywhere.

Anyway, on with the program. I feel obliged to do the standard JavaOne recap... Let's just say that it was 400 times better than last year's JavaOne. This year, the mood was brighter, the products were cooler, and everyone I talked to was incredibly stoked about Java again (must be the new logo). The sessions all seemed to go well, and we had a lot of good interaction with folks at our booth and at the client group BOFs. On top of all that, we finally launched the javadesktop.orgcommunity site, which gave me a release vehicle for the project I've been hacking on recently, known quite unaffectionately as "Mu".

Possibly the greatest news we've had in a while was last week's announcement of the Game Technologies Group at Sun. I've had various lunchtime conversations with members of the new team, and believe me, this is one sharp group. Their charter is to find the deficiencies in the Java platform that prevent developers from writing leading edge games entirely in Java, and then plug those holes. One thing that really makes me cringe is when someone says, "You can't do that with Java". Well, have you seen "Alien Flux"? Did you see the High Dynamic Range OpenGL demos presented by Ken Russell and Chris Klein at JavaOne? With the GTG's release of open source Java bindings forOpenGL, OpenAL, and input controllers, I think you'll be hearing that "you can't do that" statement a lot less. [Ahh, I'm overcome with memories of a certain Canadian children's televsion program.]

Another complaint we've received in the past is that we have many great media technologies (Java 2D, Java 3D, JMF, JavaSound, JAI, Swing, and so on), but they don't work all that well together. It's great to know that we now have this team dedicated to making all these components fit together into one coherent layer. If all goes well, developers should no longer worry about mixing heavyweight components with lightweights, playing back video in a 3D application, or using the flexibility of Swing to create an interactive heads-up display in a 3D game.

Well, this first blog entry was all over the map, eh? Next time I'll pick one topic and stick to it like maple syrup.

In my ears: "Electric Version", The New Pornographers
In my eyes: "Blindness", Jose Saramago