Justin du Coeur (jducoeur) wrote,
Justin du Coeur

[GEEK] Microsoft setting the pace

Okay, so at a couple of recommendations from the Uno de Mayo party, I just did a very quick peek at the Java 1.5 specs. I'm interested in comparing notes with folks who are more current on Java than I am. I was a Java geek way back when, at the beginnings of the language, but haven't been tracking it closely since about 1.2, so I may be missing some details.

Impression 1: okay, I think it deals with most of the obvious shortcomings -- going from C# back to Java wouldn't be quite as painful.

Impression 2: I think that Sun is falling into a dangerous trap, of allowing Microsoft to set the running here. I mean, looking at the bulleted new features for Java 1.5, I find:

-- Autoboxing/Unboxing: been in C# from the beginning.

-- Enhanced for loop: been in C# from the beginning, and I find C#'s syntax clearer. Also, C# will edge ahead again in its upcoming release, which adds yield, making iteration programming much easier.

-- Generics: hitting C# and Java at about the same time. (I'm assuming that Java's bounded wildcards and C#'s constraints provide roughly comparable capabilities.)

-- Typesafe Enums: been in C# from the beginning.

-- Varargs: been in C# from the beginning. (I'm assuming that, although the examples are all "Object...", you can specify any type there -- otherwise, C#'s version is more powerful.)

-- Static import: an advance over C#. Part of me really likes this feature, part of me finds it a bit dangerous in terms of potential namespace collisions. I'll have to chew on this one.

-- Metadata: been in C# from the beginning. I can't find any bloody documentation on how it works in Java, especially how one defines new metadata types, but the syntax examples I'm seeing make me nervous that it isn't as powerful and easy to use as the C# version. (Metadata, AKA attributes, are essential to real C# power programming. I use it extensively -- it lets you write much cleaner and more decoupled code if you know what you're doing. The combination of reflection plus attributes is hugely powerful.)

And they still haven't caught up with C# 1.0, as far as I can tell -- I'm not finding either class properties or anything like the strongly-typed delegate/event model, which are respectively very nice and wonderful. Worse, Microsoft isn't standing still -- the next version of C# adds generics and yield, as mentioned above. They're also adding anonymous methods (lambda functions) -- are these in Java yet? Finally, they're adding partial types (allowing you to split a type across multiple files), which won't change the world but will make generated code a good deal more manageable.

The problem, of course, is that if Java winds up in a mode of playing catch-up with C#, it's going to lose in the long run. The only way to be competitive with Microsoft is to stay ahead of them; that's been proven in many different arenas.

And truth to tell, while I very much like C#, I don't want to see Java in trouble. Microsoft is very consistent: when there's a viable competitor, they tend to be reasonably innovative and interesting, but as soon as they're left alone in a field they get lazy. C# will continue to develop as a decently cutting-edge language only so long as Java is forcing it to do so. And being a serious language geek (and a heavy consumer of most of these cutting-edge features), I don't want the pace of advancement to slacken...
  • Post a new comment


    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded