Neill Newman wrote:
Largely. As an analogy, in database design sometimes one has to de-normalise a perfect database for efficiency. It's rather inefficient to store a 32 bit reference to a 32 bit number, and for chars it's much worse. Fx, "Hi World" is 8 chars (ignoring terminator). This is 8 bytes in Java, or 8*4+8 = 40 in MangleLang.
hope I'm not being pedantic, but Java stores a character as 16 bytes, it uses unicode...
I knew that really. <woops> It's still ridiculous to use 6N bytes to store 2N bytes of data. And before someone mentions, yes I know most of java.lang.String 's methods are native anyway and hence my example doesn't apply, but this is another instance of denormalisation for the sake of efficiency.
Alexis