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-07-20 23:27:21
From:   anonymous2
Response to: C, C++, Java, maybe others - zeroth element arrays

Well, it's like some countries count the "first floor" as the "ground floor", whereas some other countries count "first floor" and "ground floor" differently...


Note that those countries that count the "first floor" as the "ground floor" typically count "lower ground" floors as "basements" (e.g. "B1" or "basement 1" level)... Hence skipping the "zeroth" floor entirely... Whereas "ground floor" countries count it as "zero floor", and count the "B1" level equivalent as "lower ground" level(s).


"0" index arrays has its uses, but from a memory management perspective in terms of C (and C++), it makes sense... For every other language, it MAY be different (JScript allows non-zero aligned arrays).


Just like different languages has its own uses, the indexing schemes has its own uses as well...


No use quarrelling over it, UNLESS you're designing a new language, then you can suitably implement the "proper" indexing scheme that SUITS the PURPOSE (not the language/architecture/etc).