> Computers > Programming
Various Topics Home | Disclaimer | Report Adult Posts

Various Topics on Programming



Programming - "Looking for a quote" in Computers


Old 06-08-2007   #1
..ir.. ..usbour..
 
Default Looking for a quote

Someone says that in answer to the old debate of whether arrays
indexing should start from 0 or 1 , his suggestion that it should
start from 1/2 did not receive proper attention.

Does anyone know who said it and exactly how it was phrased ?

 
Old 06-08-2007   #2
..bertwesse.. ..hoo.c..
 
Default Re: Looking for a quote

On Jun 7, 11:38 pm, Spiros Bousbouras <spi...@gmail.com> wrote:
> Someone says that in answer to the old debate of whether arrays
> indexing should start from 0 or 1 , his suggestion that it should
> start from 1/2 did not receive proper attention.
>
> Does anyone know who said it and exactly how it was phrased ?



Stan Kelly-Bootle:

"Should array indices start at 0 or 1? My compromise of 0.5 was
rejected without, I thought, proper consideration."

 
Old 06-08-2007   #3
..ir.. ..usbour..
 
Default Re: Looking for a quote

On 8 Jun, 05:55, "robertwess...@yahoo.com" <robertwess...@yahoo.com>
wrote:
> On Jun 7, 11:38 pm, Spiros Bousbouras <spi...@gmail.com> wrote:
>
> > Someone says that in answer to the old debate of whether arrays
> > indexing should start from 0 or 1 , his suggestion that it should
> > start from 1/2 did not receive proper attention.

>
> > Does anyone know who said it and exactly how it was phrased ?

>
> Stan Kelly-Bootle:
>
> "Should array indices start at 0 or 1? My compromise of 0.5 was
> rejected without, I thought, proper consideration."


Thank you , that was very fast.


 
Old 06-08-2007   #4
..Falcon..
 
Default Re: Looking for a quote

Spiros Bousbouras wrote:
>
> Someone says that in answer to the old debate of whether arrays
> indexing should start from 0 or 1 , his suggestion that it should
> start from 1/2 did not receive proper attention.
>
> Does anyone know who said it and exactly how it was phrased ?


That would create interesting effects, since the habit is to round
up in North America, round down in Europe.

--
<http://www.cs.auckland.ac.nz/~pgut001/pubs/vista_cost.txt>
<http://www.securityfocus.com/columnists/423>
<http://www.aaxnet.com/editor/edit043.html>
<http://kadaitcha.cx/vista/dogsbreakfast/index.html>
cbfalconer at maineline dot net


--
Posted via a free Usenet account from http://www.teranews.com

 
Old 06-08-2007   #5
..ber.. ..ltm..
 
Default Re: Looking for a quote

"robertwessel2@yahoo.com" wrote:
Spiros Bousbouras wrote:
>> Someone says that in answer to the old debate of whether arrays
>> indexing should start from 0 or 1 , his suggestion that it should
>> start from 1/2 did not receive proper attention.
>>
>> Does anyone know who said it and exactly how it was phrased ?


>Stan Kelly-Bootle:
>
>"Should array indices start at 0 or 1? My compromise of 0.5 was
>rejected without, I thought, proper consideration."


Not what the OP asked, but still 0.18% on topic:

Edsger Dijkstra's - "Why numbering should start at zero" at EWD's
archive:

http://www.cs.utexas.edu/users/EWD/ewd08xx/EWD831.PDF

Roberto Waltman

[ Please reply to the group,
return address is invalid ]
 
Old 06-08-2007   #6
..ckdropp..
 
Default Re: Looking for a quote

Roberto Waltman <usenet@rwaltman.net> wrote in
news:rdaj63dg087s3e0fr596suqf9f0k02g4ac@4ax.com:

*snip*

>
> Not what the OP asked, but still 0.18% on topic:
>
> Edsger Dijkstra's - "Why numbering should start at zero" at EWD's
> archive:
>
> http://www.cs.utexas.edu/users/EWD/ewd08xx/EWD831.PDF
>
> Roberto Waltman


Why not allow the programmer to specify any range he/she wants? Forget
this "start at 0 or 1" thing, I want to start some ranges at 15 and end
at 32. Ada lets me do this sort of thing, C++ not so much. (I know, I
can do an enum and start the range at "fifteen" or something, but numbers
are easier to scan for. http://www.useit.com/alertbox/writing-
numbers.html)

Puckdropper
--
Wise is the man who attempts to answer his question before asking it.

To email me directly, send a message to puckdropper (at) fastmail.fm
 
Old 06-09-2007   #7
..bertwesse.. ..hoo.c..
 
Default Re: Looking for a quote

On Jun 8, 2:30 pm, Puckdropper <puckdrop...@yahoo.com> wrote:
> Why not allow the programmer to specify any range he/she wants? Forget
> this "start at 0 or 1" thing, I want to start some ranges at 15 and end
> at 32. Ada lets me do this sort of thing, C++ not so much. (I know, I
> can do an enum and start the range at "fifteen" or something, but numbers
> are easier to scan for. http://www.useit.com/alertbox/writing-
> numbers.html)



Well, I certainly don't want to start this particular flame fest
again, so perhaps I should divert it by first mentioning my preferred
brace placement style for C... ;-)

Being able to specify a range is fairly common, and certainly in
anything with a strong Pascal heritage (like Ada).

My experience has been that bases only rarely something other than
zero or one, but if you're going to allow that to vary on an array-by-
array basis, you might as well allow the range, just because it
probably falls fairly naturally out of whatever syntax you've used to
declare that the array is base zero or one anyway.

More commonly when the situation needs something more complex than a
simple base zero or base one index, you really want something more
along the lines of an ***ociative or keyed lookup.

And in C++, you can certainly create your own type and define
operator[](int).

 

Thread Tools
Display Modes





Powered by vBulletin®
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0