Click here to Skip to main content
15,911,786 members

Survey Results

Should array indexing start at 0 or 1?   [Edit]

Survey period: 7 Mar 2011 to 14 Mar 2011

Old school VB devs and old school C devs know the answer. What's your feeling in this modern, enlightened era?

OptionVotes% 
01,11587.93
115312.07



 
GeneralRe: It should be a choiche, in high level programming languages Pin
OriginalGriff6-Mar-11 21:41
mveOriginalGriff6-Mar-11 21:41 
GeneralRe: It should be a choiche, in high level programming languages Pin
Johnny J.6-Mar-11 21:46
professionalJohnny J.6-Mar-11 21:46 
GeneralRe: It should be a choiche, in high level programming languages Pin
Emilio Garavaglia7-Mar-11 4:03
Emilio Garavaglia7-Mar-11 4:03 
GeneralRe: It should be a choiche, in high level programming languages Pin
Rob Grainger7-Mar-11 22:10
Rob Grainger7-Mar-11 22:10 
GeneralRe: It should be a choiche, in high level programming languages Pin
Emilio Garavaglia8-Mar-11 4:33
Emilio Garavaglia8-Mar-11 4:33 
GeneralRe: It should be a choiche, in high level programming languages Pin
Klaus-Werner Konrad13-Mar-11 2:41
Klaus-Werner Konrad13-Mar-11 2:41 
GeneralRe: It should be a choiche, in high level programming languages Pin
Emilio Garavaglia13-Mar-11 8:14
Emilio Garavaglia13-Mar-11 8:14 
GeneralRe: It should be a choiche, in high level programming languages Pin
Klaus-Werner Konrad13-Mar-11 10:04
Klaus-Werner Konrad13-Mar-11 10:04 
Well - in your FIRST year of life you are 0 years old Smile | :)

Generally an array index is not more than the OFFSET from the start of the array, and the count is the length.

So the first element is from offset 0 to offset 1, the second element is from offset 1 to offset 2 and so on.

And, NO, it shouldn't be context sensitive, just for consistency.
It would be absolutely confusing if one array would start with 0, the next with 1, the third with 19.75 ...
GeneralRe: It should be a choiche, in high level programming languages Pin
Emilio Garavaglia13-Mar-11 21:05
Emilio Garavaglia13-Mar-11 21:05 
GeneralRe: It should be a choiche, in high level programming languages Pin
Klaus-Werner Konrad14-Mar-11 11:15
Klaus-Werner Konrad14-Mar-11 11:15 
General...except when... PinPopular
OriginalGriff6-Mar-11 20:59
mveOriginalGriff6-Mar-11 20:59 
GeneralRe: ...except when... Pin
Johnny J.6-Mar-11 21:40
professionalJohnny J.6-Mar-11 21:40 
GeneralRe: ...except when... PinPopular
OriginalGriff6-Mar-11 21:42
mveOriginalGriff6-Mar-11 21:42 
GeneralRe: ...except when... Pin
Nagy Vilmos7-Mar-11 6:55
professionalNagy Vilmos7-Mar-11 6:55 
GeneralRe: ...except when... Pin
OriginalGriff7-Mar-11 8:27
mveOriginalGriff7-Mar-11 8:27 
GeneralIt should start from 0 in a high-level programming language. PinPopular
OriginalGriff6-Mar-11 20:58
mveOriginalGriff6-Mar-11 20:58 
GeneralRe: It should start from 0 in a high-level programming language. Pin
Johnny J.6-Mar-11 21:39
professionalJohnny J.6-Mar-11 21:39 
GeneralRe: It should start from 0 in a high-level programming language. Pin
OriginalGriff6-Mar-11 22:04
mveOriginalGriff6-Mar-11 22:04 
GeneralMessage Removed Pin
7-Mar-11 4:34
professionalN_tro_P7-Mar-11 4:34 
GeneralRe: It should start from 0 in a high-level programming language. [modified] Pin
Indivara6-Mar-11 22:07
professionalIndivara6-Mar-11 22:07 
GeneralRe: It should start from 0 in a high-level programming language. Pin
hairy_hats7-Mar-11 0:21
hairy_hats7-Mar-11 0:21 
GeneralRe: It should start from 0 in a high-level programming language. Pin
Indivara7-Mar-11 3:46
professionalIndivara7-Mar-11 3:46 
GeneralRe: It should start from 0 in a high-level programming language. Pin
Pritesh Aryan7-Mar-11 18:09
Pritesh Aryan7-Mar-11 18:09 
GeneralRe: It should start from 0 in a high-level programming language. Pin
Indivara8-Mar-11 3:05
professionalIndivara8-Mar-11 3:05 
GeneralRe: It should start from 0 in a high-level programming language. Pin
Bassam Abdul-Baki7-Mar-11 1:13
professionalBassam Abdul-Baki7-Mar-11 1:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.