ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.

advertisement

AddThis Social Bookmark Button
Article:
  What I Hate About Your Programming Language
Subject:   C, C++, Java, maybe others - zeroth element arrays
Date:   2003-05-14 13:15:40
From:   anonymous2
Response to: C, C++, Java, maybe others - zeroth element arrays

Because it's not always just a compile time fix. If a variable is used in the index, the 'minus one' must be done at runtime. In math intensive stuff, this can be devastating. The best thing I think is a 1-based default, and an option to revert to 0-base on specific arrays.

1 to 1 of 1
1 to 1 of 1