Monday, August 01, 2005

Things I'd ignore from Tiger

Autoboxing

Auto(un)boxing refers to the auto-conversion (language-wise) of primitive to their Object wrapper counterparts when dealing with collections. For example, we can add an Integer into an ArrayList but not int. The reason behing autoboxing is that the old-school way of dealing primitives in a collection requires unnecessary amounts of extra coding. I definitely won't jump into this bandwagon just for the sake of using it. Why? Because, I am traditionalist. I like the old Java the way it is. I like to code my program the way I know it should and not allowing any pre-compilers to abstract something for me. I'd love to ignore autoboxing for compatibility purposes (ie. Java 1.4, GCJ, GNU Classpath, etc.). Though a bit blunt, I would honestly say that using this stuff would pull away developers from the essentials and will make developers more lazy and complacent.


Generic Types

Generics have been widely anticipated by the community. I am part of that community, but I'd say, I don't want it. I don't need it. In generics, a collection can be "type-casted" into a specific element object (ie. an ArrayList may only be permitted to contain Integer objects). Adherents of generics has to simply declare the collection type with the element type the <> notation (eg. ArrayList). For the same reason as I mentioned for autoboxing, usage of this new "facility" or shall I say capability will deviate from my old-school thingking. I code best with 1.4 semantics. Some would say that generics will definitely improve development output. But not for me.


Varargs

The varargs functionality allows multiple arguments to be passed as parameters to methods. It requires the simple ... notation for the method that accepts the argument list and is used to implement the flexible number of arguments required for printf. Guys, varrags destroys the object-oriented paradigm of Java. I am firmly against this.


Static Import

The static import feature, implemented as "import static", enables you to refer to static constants from a class without needing to inherit from it. This is another toys-for-lazy-boys feature. This will definitely distracts one's thinking in a correct OO way and will direct a java newbie to the dark side.


Enhanced for Loop

The new enhanced for loop can replace the iterator when simply traversing through a Collection as follows. The compiler generates the looping code necessary and with generic types no additional casting is required. Just another lazy-coder stuff and a why-fix-when-not-broken stuff. Brutally useless.


As you can see, all that I chose to ignore are of the Java language semantics. I would love to take the new API features. Tiger definitely has lots of them. Happy programming! Old-school Java lang semantics rules!!!

2 comments:

Anonymous said...

here here. this are really stupid additions.

Anonymous said...

I would have been happier if closures and design by contract had been added to the language. However, I must admit that I like generics.