|
Mathematically,
for (int index = 1; index <= array.Length; index++) would be the right way to say it and count it.
It's been drilled into programmer's heads that 0 is better than 1 that it has become a religious offense to state otherwise.
|
|
|
|
|
We're all someone's infidel. Death to all, and to all a good night.
|
|
|
|
|
And double death to all who can't use a spell-checker!
------------------<;,><-------------------
|
|
|
|
|
OriginalGriff wrote: it makes loops work more obviously:
for (int index = 0; index < array.Length; index++)
A really obvious way would be something like:
for i in (1, array.Length]
|
|
|
|
|
To be fair, you could write
for (int index = 1; index <= array.Length; index++)
(but I prefer 0-based arrays too)
Regards
Thomas
Disclaimer: Because of heavy processing requirements, we are currently using some of your unused brain capacity for backup processing. Please ignore any hallucinations, voices or unusual dreams you may experience. Please avoid concentration-intensive tasks until further notice. Thank you.
|
|
|
|
|
...because it represents a higher abstraction semantic (first item) rather than an implementation technicality (address offset).
This is what I spect from a programming language not close to the machine.
(by the way, I'm a C# developer which never uses unsafe pointers and things like that).
Wake up! The Singularity is coming.
|
|
|
|
|
nmarcel wrote: because it represents a higher abstraction semantic (first item) rather than an implementation technicality (address offset).
Absolutely agreed.
It should be start with 1.
Regards.
|
|
|
|
|
0 or 1 are BOTH implementation technicalities . Convention in this respect is more important .
|
|
|
|