VisionSet coughed up:
I wonder why they didn't make it a length() method - would feel more
intuitive especially since you stumble across this very early in
learning the language.
How could they have included the Array type in the javadocs?
It's funny how an innocuous post like yours get come under such fire! LOL.
Welcome to Anal Quote International. I'm an offender too. In fact, I liked
it so much I bought the company.
I've always suspected that .length is a primitive and not an object is
because of a few things:
1. The array length is not something run-time
computable. The length is indeed immutable.
2. Efficiency (speed).
3. There is no need for it to be synchronized, as
a single primitive read is defined as atomic.
I've always wondered why there wasn't a specific class called Array that
/meant/ the array (forget he existing Array and Arrays classes). It would
allow us to use instanceof, instead of calling a dedicated method to check
an object for "arrayness". Furthermore, it might allow for some interesting
subclasses.
--
Unix users who vehemently argue that the "ln" command has its arguments
reversed do not understand much about the design of the utilities. "ln
arg1 arg2" sets the arguments in the same order as "mv arg1 arg2".
Existing file argument to non-existing argument. And in fact, mv
itself is implemented as a link followed by an unlink.