|
|||||
|
|
#1 |
|
|
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 ? |
|
|
#2 |
|
|
> 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." |
|
|
#3 |
|
|
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. |
|
|
#4 |
|
|
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 |
|
|
#5 |
|
|
"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 ] |
|
|
#6 |
|
|
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 |
|
|
#7 |
|
|
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). |