Lam
unread,Apr 11, 2011, 9:23:25 AM4/11/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to javapractices-dot-com-discuss
I find articles on javapractices very ambiguous - that many of the
articles promote beliefs above and beyond what its title suggests.
For example, "Iterate without an index".
I fully agree that for each and iterators should be preferred over the
use of indices if the index is not used for any other purpose than the
iteration.
However, to say "In addition, the (rather unnatural) computer science
tradition of starting loop indexes from 0 instead of 1 is a continual
source of trivial errors" is ignorant. Starting from 0 is the most
natural thing to do, and you'll run into problems and run into edge
cases sooner or later if you don't start with 0.