Re: [GD-General] Java bitching
Brought to you by:
vexxed72
From: Colin F. <cp...@ea...> - 2002-01-04 09:39:59
|
January 4th, 2002 Friday >>> http://www.jwz.org/doc/java.html >>> >>>Brian Let me add a Java gripe! I was disappointed that something like the following Java code doesn't compile: // Loss of precision: int to byte byte [] a = { 0xff, 0x7f }; Forcing me to do this: // Okay byte [] a = { (byte)0xff, (byte)0x7f }; It just makes the code ugly when there are, say, 1024 bytes in a table! I think the Java compiler could postpone deciding that hex literals in a byte array are 'int', and go with the assumption that they're 'byte' until an excessive value, like 0x100, is encountered! Why not? Confusion? ;-) Also, although I can see how having signed integer types (char, short, int, long) eliminates the wacky math situations that can arise with UN-signed types, I sometimes wish I could use an unsigned integer type in Java. I guess using 31 bits of "int" is okay, and then you need to go to "long" for 32 up to 63 unsigned bits. But I was porting a table of 32-bit unsigned int's from C to Java, and having to do all operations in terms of "long"'s seems like a waste. I'll admit, the low-level bit madness I am dealing with is probably not the kind of computer science Java is promoting -- so I downgrade this "gripe" to "tale of inconvenience". I don't want Sun's QA to enter another "Highest Priority" entry in the Gripezilla or GripeTracker database on my account! --- Colin |