Java vs .Net – Specifics

Today’s episode was brought to you by my colleague Griffin’s post about J2EE. While I don’t really mind what anyone’s programming language preference is (everyone knows Smalltalk is the best, right?), I find the lack of details…. disturbing. Get specific! Otherwise its just ranting, and we wouldn’t want that would we?

So, some specific shortcomings of Java that are affecting me right now:

Insufficient separation of classloader hierarchies. Its almost impossible to successfully deploy 2 versions of the same class in a single JVM. This is often manifested by XML parsers and the resulting musical chairs of classpath reordering to try and get the ‘right’ one to load first. .Net’s AppDomains do a better job. The ray of light in this case is the MVM (aka ‘Barcelona’) project that introduces Isolates and should be in Java 1.6.

JTable. Very powerful, but the degree of subclassing and overriding you have to do for anything beyond the basics is scary. Plus there’s always the nagging fear that you’ll get 80% done and hit a wall that forces you to throw it all away and reimplement as a bunch of custom panels and labels and…. GridBagLayouts. Oh, GridBagLayout. If ever there was a class that needed an entire book devoted just to it, this is the one. Sure its possible to layout the UI in almost any way imaginable using this layout but you’ll find out just how many ways there are to do it wrong in the process. And just when you think you’ve got it sorted, you innocently try resizing the window…. (cue Psycho stabbing music). Argh!