Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

Re^3: why the array index has to start at 0??

by roboticus (Chancellor)
on Dec 21, 2012 at 16:32 UTC ( #1009934=note: print w/replies, xml ) Need Help??

in reply to Re^2: why the array index has to start at 0??
in thread why the array index has to start at 0??


I don't think it's silly, rather it just moves the question a bit. As you indicate, the question is merely moved to "which is the better way of expressing a range". It seems that Djikstra prefers "0 <= i < N" to "1<= i < N+1". However, he doesn't say why that's any better. I agree that it looks better, but there's another formulation "0 < i <= N" that looks just as good. Why isn't that just as good? He leaves the question open.


When your only tool is a hammer, all problems look like your thumb.

  • Comment on Re^3: why the array index has to start at 0??

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1009934]
[jedikaiti]: Pretty!
[erix]: ( TBH, I think it's a load of bull -- but maybe I'm mistaken )
[erix]: Hey that's Hungary - wave down ambrus and tell him to reboot his systems!
[choroba]: it might be a problem if you expect to reach the maximal possible value soon without squashing the ids
[erix]: that's really impossible with bigint
[erix]: and the site is still only 'hopefully' active :)
[erix]: but fair enough, he may think he solves a problem

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (10)
As of 2017-06-23 15:45 GMT
Find Nodes?
    Voting Booth?
    How many monitors do you use while coding?

    Results (551 votes). Check out past polls.