Des (deskitty) wrote,

  • Mood:

Java Sucks. Period.

Grrrr. Java is a shitty, shitty language that wasn't properly thought-through by its developers. Now that I'm programming in it 8 hours a day, I'm only beginning to truly appreciate this.

I think I'm going to start keeping a list of all the mistakes in Java, so that whenever I get around to building my own language, I know what NOT to do. (Most of these apply to Java 1.4 -- anything newer is irrelevant to me, since much of our customer base doesn't have anything newer.)

  1. Java is too damn verbose. "import com.locutour.clientmanager....". "public static final ...". "new ActionListener() { public void actionPerformed(ActionEvent e) { ... } }", etc.
  2. It doesn't have lambdas. Anonymous inner classes are a poor substitute.
  3. You can't initialize the member data of anonymous inner classes using local variables. If you want to do things like that, you have to create a named inner class. (Having this feature would help mitigate #2 somewhat.)
  4. Somehow, rectangles are allowed to have negative widths/heights. I caught AWT/Swing feeding me a negative clip width the other day. (And yes, I checked to make sure it wasn't my code that was doing it.)
  5. Rectangle2D has convenient Rectangle2D.Float and Rectangle2D.Double implementations. Dimension2D has no such thing. (Why the hell not?)
  6. One would think a rectangle would be composed of a point and a width/height (or set of dimensions). Yet it is not possible to get a Point or Dimension object out of a rectangle -- you have to construct one manually from the individual coordinates.
  7. Swing is dumb about resizing things. If I want to extend/retract a widget, I must call revalidate(), which in turn repaints the whole widget. I've found no easy way to change the size of a widget without repainting everything. This is a rather annoying thing to do 15+ times per second, as it wastes a lot of CPU time.
  8. Swing is retarded about resizing things. If you have a toplevel window which is too small for its contents, rather than resize the window, Swing will just clip the bottom/right sides. So I have to guess at a reasonable starting size for a window, and hope it's big enough on all platforms in all situations.
  9. GridBagLayout is absurdly complex. GridBagLayout is also the only layout that does anything useful.
  10. Generics are not templates. This means they are both more complex ("? extends", anyone?) and less useful.

I know I've run across plenty more that I'm forgetting.

I could understand seeing most of these problems in 1.0, or maybe even up to 1.2. But how the hell did they make it all the way to 1.4?

-- Des
Tags: java, programming languages

  • (no subject)

    If you want to know what my life is like, look no further. Really, that's all there is to it. -- Des

  • For those of you poor sods on Comcast...

    Via Slashdot: One more reason to dump Comcast and get a real ISP -- Des

  • Looking for a VPS provider

    So I'm thinking it's about time to start looking for dedicated hosting somewhere -- with my unstable living situation, keeping the server at home…

  • Post a new comment


    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded