Issues with Java
Posted by Skrud at Thursday, March 31st 2005 at 11:38am
For the most part my Software Engineering project is a lot of fun, and the more I code in Java, the more I appreciate it. Unfortunately I’ve developed some irksome issues with Java that have been gnawing away at me:
- Java is anal-retentive. And by that I mean that it is obnoxiously strongly typed. Integers can’t be implicitly cast as boolean, so I basically have to check if an integer is not equal to zero every time… (Actually I wrote a simple function: boolean intToBool(int a) { return (a == 0) ? false : true; }. It’s still annoying. Similarly, a is not considered false. Which means that in some cases I have to explicitly check if something is equall to null. That’s pretty damn redundant… Stupid Java. What the hell else would
nullbe? (Maybe it’s just the C programmer in me that is thinking “How could null be anything but false? You must be crazy not to consider it to be false. It’s null. It’s nothing, by definition, that’s false).null - Java is anal-retentive. This time, more than just being strongly typed, I can’t store any primitive types in a Collection class. Instead, I would have to wrap the primitive in an object wrapper, causing me to convert from an class to an
Integertype every single time I want to get a value. (Simply because theintclass is not what I need, and further complicates things). While Googling for a solution I came across an interesting discussion on the subject… But I’m still working on finding an elegant solution to associating a Weapon with the amount of ammunition. The closest thing I’ve found is a method on wrapping primitive types in one-element arrays, which may be clever, but it’s still a dirty hack. Wait a minute, are we even supposed to be implementing ammunition? This may have all been a waste of time….Integer - Eclipse is really great. I adore the integrated CVS. But the one thing that ticks me off is that I can’t seem to keep two versions of the project file in our CVS repository, even though I need a different one for Linux and Windows (simply because the libraries are different for Linux and Windows, and which libraries get linked is information that’s in the .project file…). But maybe this can be fixed by creating a new CVS branch or something … Until then I just keep changing it manually everytime I’m doing development in Linux.
The important thing, though, is that it’s working :D





