A
Andreas Leitgeb
Mark Space said:"length" confuses me because it's not an operator. Also I don't see
much readability difference between "length" and "length()". (Or
"size()" for that matter.)
arrays are just too different from Collections.
If I could pass an array to a function taking e.g. a List,
then the array would need to have real methods, that implement
the interface's methods. This also breaks with arrays of primitive
types. I don't think, this is a good way to go.
I do not propose using brackets for anything else than arrays,
but that should not stop me from discussing it anyway:
Set<Integer> sieve = //...
sieve[2] = // ...??
if( sieve[3] )
Set read: .exists() -- write: .add() or .remove, depending on whether
true or false is written to it.
List read: .get() -- write: .set()
Map read: .get() -- write: .put()
Sounds good so far, but what to do with classes that implement more than
one of those?
I'd rather concentrate on sane arithmetics with special numeric classes
for now.