Friday, February 16, 2007

 

Making the leap to Java 1.5

Okay, so autoboxing sucks.

This was supposed to be a big feature that would save some typing, save some needless work and let things happen simply, the way the SUN intended.

Not so much.

There's no NULL handling behind the scenes, so with every autoboxing operation you do, you're just setting yourself up for an NPE. Forget it. Forget the three seconds of typing time you're saving and just leave the code the way it was. Obscure? Fine. Fuck it.

Don't use Objects, ever. Ever. Use primitives or you'll get some NPE you'll never chase down. The Classes have enough static members that use primitives that you'll never have to use an Object (hopefully) and then you won't have to worry about whether you're unintentionally autoboxing a stupid Object and setting yourself up for debugging hell.

Just use the primitives, man. And forget about autoboxing.

Until more later on,

Liam

Labels: ,


Comments: Post a Comment



<< Home

This page is powered by Blogger. Isn't yours?