Path: utzoo!mnetor!uunet!lll-winken!lll-tis!ames!eos!eugene From: eugene@eos.UUCP (Eugene Miya) Newsgroups: comp.lang.misc Subject: Re: The Joy of Zero-based Arrays (My two cents) Message-ID: <248@eos.UUCP> Date: 3 Mar 88 18:30:03 GMT References: <1012@PT.CS.CMU.EDU> <17419@think.UUCP> Reply-To: eugene@eos.UUCP (Eugene Miya) Organization: NASA Ames Research Center, Calif. Lines: 18 Summary: Considering other languages. Given the choice of a 0 or 1 start, I now prefer 0, there are a few applications where it is handy and you just make the array +1 larger, or ignore element 0. but this is a cludge as well. Actually, I think that Pascal and Ada handle this problem even better with subranges and enumerations, but this is my quirk, Pascal's problem is those stupid pred() and succ() operators. Yes, range checking can be a pain (read "reduced performance"). Another problem is how to handle subarrays. Implementation is row or column major (See comp.lang.fortran) and this is an unfortunate detail. There are other array tricks coming down the pipe (read Fortran 8X) but when it boils down to either 1 based or 0 based are both arbitrary (ridiculous since either side can find counter arguments). From the Rock of Ages Home for Retired Hackers: --eugene miya, NASA Ames Research Center, eugene@ames-aurora.ARPA "You trust the `reply' command with all those different mailers out there?" "Send mail, avoid follow-ups. If enough, I'll summarize." {uunet,hplabs,hao,ihnp4,decwrl,allegra,tektronix}!ames!aurora!eugene