Archive for September, 2011

Things I hate about Java Post #1

The more I use Java, the more I feel like I’m fighting the language to get it to do what I want. Here are some things that make me feel this way.

  1. No unsigned integer types.
    I don’t buy the arguments for not including unsigned types and the workarounds seem even more cumbersome than the messiness that mixing unsigned and signed values in arithmetic creates. In addition, when has ANYONE (other than a Java programmer) ever used a signed byte? I’ve only seen unsigned bytes, especially in I/O code.
  2. No callbacks
    Sure, you can use an interface to simulate this, but it’s much more cumbersome. C#’s delegates and especially its lambda functions (compact syntax for anonymous methods) are more elegant and powerful.
  3. Type erasure
    In Java, generics only exist at compile-time. At compile-time the type checks are removed and replaced with casts where necessary. This means that you cannot query a generic object as to its type using reflection, nor pass a generic class Type as a parameter.

That’s all I can think of right now, but I will make another post once I get back to programming in Java and find some more.

1 Comment