Click here to Skip to main content
15,921,169 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: These results surprise me. Pin
hairy_hats11-Mar-11 0:33
hairy_hats11-Mar-11 0:33 
GeneralRe: These results surprise me. Pin
Klaus-Werner Konrad13-Mar-11 2:13
Klaus-Werner Konrad13-Mar-11 2:13 
GeneralHere's why 0-based indices are beautiful: [modified] Pin
Daniel Grunwald7-Mar-11 19:41
Daniel Grunwald7-Mar-11 19:41 
GeneralRe: Here's why 0-based indices are beautiful: Pin
Member 31167107-Mar-11 20:50
Member 31167107-Mar-11 20:50 
GeneralRe: Here's why 0-based indices are beautiful: Pin
MarqW7-Mar-11 21:02
MarqW7-Mar-11 21:02 
GeneralRe: Here's why 0-based indices are beautiful: Pin
Kamran Behzad10-Mar-11 17:10
Kamran Behzad10-Mar-11 17:10 
GeneralRe: Here's why 0-based indices are beautiful: Pin
Daniel Grunwald10-Mar-11 20:24
Daniel Grunwald10-Mar-11 20:24 
GeneralI can't Understand? Pin
Pritesh Aryan7-Mar-11 17:57
Pritesh Aryan7-Mar-11 17:57 
GeneralRe: I can't Understand? Pin
OriginalGriff7-Mar-11 21:35
mveOriginalGriff7-Mar-11 21:35 
GeneralPeople accepted the reality... Pin
Jun Du7-Mar-11 15:09
Jun Du7-Mar-11 15:09 
GeneralRe: People accepted the reality... Pin
Chaveca_8-Mar-11 23:00
Chaveca_8-Mar-11 23:00 
GeneralRe: People accepted the reality... Pin
Lex Steers10-Mar-11 6:48
Lex Steers10-Mar-11 6:48 
GeneralI don't give a rats Pin
Mycroft Holmes7-Mar-11 14:01
professionalMycroft Holmes7-Mar-11 14:01 
GeneralBoth? Pin
PJ Arends7-Mar-11 6:46
professionalPJ Arends7-Mar-11 6:46 
GeneralRe: Both? Pin
Nagy Vilmos7-Mar-11 7:10
professionalNagy Vilmos7-Mar-11 7:10 
GeneralRe: Both? Pin
PJ Arends7-Mar-11 7:19
professionalPJ Arends7-Mar-11 7:19 
GeneralRe: Both? Pin
#realJSOP8-Mar-11 10:11
professional#realJSOP8-Mar-11 10:11 
GeneralRe: Both? Pin
rittjc8-Mar-11 14:29
rittjc8-Mar-11 14:29 
The problem with this is that most people are professionals and develop code professionally. This means code must be shared and co-maintained. Unless everybody is a VB developer this causes great confusion.

I used VB many years ago before C/C++ and now C#. It was for people that had no programming skills or training (as few did in those days) to be so verbose they could actually understand what was going on. It was been kept back then because of a legacy base that existed when real programming languages started emerging. Beginners thought it was the way to go because C and C++ were so complex relative to VB. So they stayed with it. VB has become close to as powerful a language as C++/C#. There are elegant things you can do with C#/C++ that you cannot do with VB. Dot Net has evened the power out.

But, there is no question that VB is a very ugly and busy language. The bounding of every declaration with an End statement and the Pascal Casing of keywords make it somewhat unreadable and cluttered so that it is harder to see what is really going on. VBers are used to it. C#/C++ers are not and it looks overly verbose. Even in the beginning where people used assembler because there were no real high level languages, the indexes always started with zero. VB adds a statement to subtract 1 from the index to use it. It has to because in memory arrays they have to use pointers and the index starts at the starting address without offsetting. No starting at zero would mean they would have decrement it for the loop in order to calculate the offset by multiply the entry size by the index. So it is more than just a waste of memory. It is also a waste of processing. Having to add the word DIM in order to declare a statement is pointless and even more cluttering. Instead of "typeof(x) you have to type TypeOf(x). That is too much usage of the shift key which slows typing. Especially if you turn the annoying syntax checker that won't let you leave the line until you fix any error in the syntax. I am still forced to use it for macros so I still get the pain. Having to know two different syntaxes is also a royal pain.

There is much bigotry against VB. I think I have listed what the main gripes are the over verbosity, silly syntax to "explain" the obvious, and the fact you don't know whether it is indexed by 0 or 1. These are unfortunate but they are legacy. They are not likely to change.

I am glad to see there is a rapid move away from VB. Having two primary languages litters the google search landscape. I don't think people use VB because they are simple minded. I just believe it is what they learned and they have experience on it and they don't want to change anymore than C# people would want to change to Java or some other language that they are not used to.

It is unfortunate that VB has this legacy. IF not for this gross mistake, this indexing issue would not exist because mid level languages ever attempted it because they saw redundant processing as a waste. As far as FORTRAN goes, it may be why VB got that tradition. But, it died on the vine long ago. VB hasn't. It is not as elegant and powerful at debugging syntax than C#. It is bad that Microsoft has to waste money with different compilers and editor support, when that time could be used to develop new tools or technologies which would benefit the entire programming world. But, it is what it is. Maybe in the future, the usage of VB would drop to a point that they could drop support for it.
GeneralMust be 0 in order to be consistent across "all" .NET languages. Pin
The Storm7-Mar-11 6:15
The Storm7-Mar-11 6:15 
GeneralRe: Must be 0 in order to be consistent across "all" .NET languages. Pin
Mike Hankey7-Mar-11 12:08
mveMike Hankey7-Mar-11 12:08 
GeneralRe: Must be 0 in order to be consistent across "all" .NET languages. Pin
rittjc8-Mar-11 14:46
rittjc8-Mar-11 14:46 
GeneralArray/Pointer/Loop/Lifts Pin
Ajay Vijayvargiya7-Mar-11 4:35
Ajay Vijayvargiya7-Mar-11 4:35 
GeneralRe: Array/Pointer/Loop/Lifts Pin
Phil J Pearson7-Mar-11 5:33
Phil J Pearson7-Mar-11 5:33 
GeneralRe: Array/Pointer/Loop/Lifts Pin
Ajay Vijayvargiya7-Mar-11 6:54
Ajay Vijayvargiya7-Mar-11 6:54 
GeneralRe: Array/Pointer/Loop/Lifts Pin
Fabio Franco8-Mar-11 3:22
professionalFabio Franco8-Mar-11 3:22 

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.