This is what drives me crazy about Java
I found this in some code today.
private static final String ASCENDING = "ascending";
private static final String DESCENDING = "descending";
Don't get me wrong, constants are good, but that's just stupid. I talked to my cube-mate Nandhu about it, and at first he said it was to save memory, but that's not true because there will only every be one "ascending" no matter if it's final or not.
We talked about how they can be good if you anticipate it changing, or if it's some sort of flag. The only positive factor we agreed upon for this instance was that it saves you from spelling errors, cause the constant is checked at compile time. That's weak IMO.
I guess it's not so much what drives me crazy about Java, but rather Java Developers. Everything must be abstracted as much as possible. I'm surprised they didn't put it into a super class, just in case other classes need it. Or maybe it should be in the service layer behind some EJB's.
Mmm, symbols make me happy.