URL of the article:

Christian's Espressions: Bloggerjacks
Welcome, Greetings, Good Day, eh!
by Christian Gross
As I sit at my desk, writing my first column for the jax magazine, I am both happy and excited, because here I'll get the space to talk about the happening trends in the Java community. Of course, talking about trends could be boring if there were no trends to talk about. However, with the Java community there needn't be any worry -- there's so much happening here all the time!

Recently Sun decided to bury the hatchet and accepted an out of court settlement with Microsoft for two billion dollars. A huge debate raged online as to whether this was good or bad for Sun, and indirectly, good or bad for Java. There were conspiracy theories, and people spouting, "Sky is falling and Java is finnshed, etc.".
Before you continue reading this column I suggest that you read these two articles: The Once and Future King: Now the Only Way Microsoft Can Die is by Suicide, and Shake Your Groove Thing: The Only Way to Beat Microsoft is by Ignoring Microsoft. Essentially, these two articles form the basis of part of my opinion. Next, note that I am writing this column on an Apple Powerbook notebook. Putting together the facts from the earlier mentioned articles, and the fact that I'm using my Apple Powerbook notebook, plus a confirmation that the sky is not falling, makes me think that there may yet be light at the end of tunnel.

Microsoft has become an important company in the technology world, whether we like it or not. Scott McNealy has probably realized the same thing and therefore decided that it's better to just take the money and run. Many people may see this as a cop out, but Scott McNealy is first and foremost a CEO who has to ensure that his employees still have their jobs tomorrow. He probably realized that fighting Microsoft is futile, since Microsoft can protract the legal proceedings raised by any government, individual, or corporation. Besides, 2 billion dollars could go a long way to keep the jobs at Sun.

For me, the Sun-Microsoft settlement is a bit of deja vu from 1997, when Microsoft invested USD $ 150 million in Apple. That money resulted in Apple becoming a company that makes interesting products and increasing their market share in what is considered a mature and stagnate market. Many people consider Apple a fringe hardware manufacturer, but in fact they are probably one of the only companies who "got" it right and who are geared up to deal with the next twenty years.

With their next generation operating system, OSX, Apple has created a system that's based on both Open Source and proprietary software. The resulting operating system is incredible in that OSX is an extremely easy-to-use and powerful UNIX operating system. It's also staggering to note that Apple with their G5 hardware are the market leaders in Grid computing, and have a 30-40 % market share among Open Source users. Apple is a thriving company and it's becoming more "cool" with each passing day.

To tie this scenario to the Sun-Microsoft deal -- Sun has the potential to become the proverbial Phoenix that rises from its own ashes. The question though, is if Scott McNealy has the gumption to do the right things, make some very hard decisions, and think in different ways like Apple did? I am hedging that this will probably be a good thing and that in five years Sun will also be an interesting and "cool" company.

My recommendation on Sun's future course of action would be for it to, first and foremost, recognize Open Source as a viable future. Sun talks a lot about Open Source, but always as a second-rate partner. Sun needs to move forward and start thinking of Linux as a first rate partner. People have bought Sun stations in the past because the hardware was the best in the market and not because it was the cheapest. Sun should stop saying Linux is not "prime time" ready and start making it "ready".

My next recommendation is to not convert Java into a me-too environment that constantly leap frogs languages like C# and environments like .NET. Java has weaknesses, but it has its strengths too -- robust multi-platform support, simplicity, and usability, to name a few. So Sun should focus on keeping the Java developer happy.
Another topic that might of interest is the debate between Bruce Eckel and the blogger Pixel. Thought it's a long read, the debate is very interesting because it talks about data typing and how generics adds a new dimension of flexibility to Java.

FYI, Bruce Eckel is the author of the Thinking series of books, and a language specialist. Besides, he has a very interesting insight on the issue of programming languages. Being a language specialist gives Bruce that special insight into how a language benefits or hinders developers. The debate between him and Pixel hinges on his initial blog entry Generics Aren't. Bruce's beef is that Java generics do not solve the generic type problem in that we still have to specialize to do dynamic programming. In contrast, a language like Python makes it easier to write truly generic code because of how Python manages constraints. I'll not rehash the debate any further - it'd be best to go to the source and read the different blog entries.

The reason why I want to raise the generics issue is because I am a bit concerned about the ramifications of generics. I learned generics from C++. Templates made C++ much more flexible and introduced a new style of programming called generic programming. Writing generic code is neither like writing interface-implementation code, nor is it like writing classical object oriented (OO) code. I would even say that writing generic object does not require using object oriented techniques. Of course, using OO code complements any generic code.
Normally, generic code is used to solve the problem of having to use type casts when iterating lists. Following is an example of how generics help to solve a problem:

while(listIterator.hasNext()) {
String item = (String)listIterator.next();
}


By using generics, we can avoid the type cast to the String object class. And, the lack of a cast is a performance increase. In such situations, generics is the way to go. The problem, however, is that developers do not stop there.
In 1995, when I started to write generic code using C++, one of my first tasks was to convert some UNIX code to the Windows NT platform. I was using Visual Studio 2.0 and Microsoft's C++ compiler, which included template support. The conversion to Windows went well until I started porting some code and strange compiler general protection faults were generated. Upon investigation I realized that the developers used templates that expanded to 80 levels. I was shocked not by the compiler limits, but by the fact that the developers had overzealously created some generic code.

Tying this back to Java, my concern is that with the release of generics a Pandora's box will be released where coding will become difficult again, and I fear is that the bar for Java developers will be raised and complexity will be introduced. The libraries within the Java standard library will not be the cause of the complexity problem. Initially, the standard libraries will simplify and bring relief to many developers. Then, as time passes more complicated libraries will be created that will make development more complicated.

Java works well because of its simplicity and minimalism. I do not recommend that you opt for generics, and end up not using it. The approach I recommend is to use generics as and when necessary, in the context of implementing a container. Writing generic code is a paradigm shift and therefore needs to be approached cautiously.

© 2004 Software & Support Verlag GmbH. Reproduction has to be permitted by the publisher. Questions?