Three Java gripes

My gripes are…

Lack of generic types

Strongly typed languages and dynamically typed languages each have their advantages but if you’re going to do it, do it properly.

Java doesn’t do it fully. Collections are built to hold generic any Object so when you retrieve something you have to cast it back to what you think it is.

RemoteExceptions being thrown from RMI

Why do I have 10 zillion catch RemoteException lines scattered all over my code?! Why do I have to create wrapper classes for remote objects that need to implement non remote interfaces?

RemoteException (much like OutOfMemoryError) is a system exception and should therefore be a runtime exception?

Mumble mumble…

I met Paul Hammant a while back who also had this gripe. Unlike me, he actually did something about it and boy does it rock. Check out AltRMI.

Getters and Setters

Lack of a decent property encapsulation mechanism. Getter and setter methods are clearly an after thought. Hands up who gets bored coding them?

Most other languages (Ruby, Python, Perl, C++, VB, Delphi) have elegant solutions to this. I feel left out.