Re: 0 based collections

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Boni,

Visual Basic has in my opinion taken the right approach that counting start
at First. In my own natural language there is not even an equivalent for
Zero other than Null (nothing).

However, it seems that developers (like me) want to stick on machine code
and use therefore the Zero as first counting position. (Counting starting in
most current cultures with our fingers, from which we have normally when we
are born ten).

However, almost every collection and array in VBNet starts at Zero, with the
exception with the one, which you should in my opinion avoid, the
VB.Collection. If you don't need that for a kind of upgrading than don't use
it. (Although it is an official Net element not a compatible element).

A in my personal opinion strange behaviour from VBNet is, that when you
create an array (and only with that). There is created one extra element.
And therefore when you want an array of 1 element you have to say.

dim mystring(0) as String ' Which is an array of 1 elements.

(It is for those who want to use the "First" element as starting indexer).

I hope this gives an idea.

Cor


.



Relevant Pages

  • Re: FFT and Sine Waves Question
    ... the number of intervals in an array is N unless we're talking about periodic thingys and then it's N+1 again. ... What does it mean to "count from zero" anyway. ... But this is about computer programmers and not children counting rocks on their fingers. ...
    (comp.dsp)
  • Re: D3/Linux compile question
    ... timeline is zero, not one. ... Remember that we are counting discrete elements and there can be no ... the plates for a wedding. ... The numbering scheme of the array _has no impact_ on the size ...
    (comp.databases.pick)
  • Re: D3/Linux compile question
    ... I may have in my pocket 1 apple, maybe 2 but I would never have -5. ... Zero is defined by subtraction, belongs to the Integer set, is neutral ... So if we go back to the requirement that all array indices to have the ... counting the element of an array from 1 is that empty or not the ...
    (comp.databases.pick)
  • Re: Quantum Computers
    ... What is wrong with counting the zero? ... through the array, ... computers and well there is no point now because it has all been done. ...
    (sci.physics)
  • Re: D3/Linux compile question
    ... There is no element of anything that is number zero. ... By the way she did not break the plates that comes after ... And, I was not counting babies, I was ... depending upon the numbering convention. ...
    (comp.databases.pick)