Re: How old is the average Fortran programmer?



Ben Hetland wrote:
Craig Powers wrote:
4. The first element in an array is zero by default, but can be made to
be 1 using an Option Base statement. I have *always* declared my arrays
in VB with an explicit lower bound (in most cases 1) so that I avoid
this problem. The default is counterintuitive, but I think it's
inherited from BASIC.

Counterintuitive or not, I think that would depend on one's background.
For a C programmer it is certainly not, but for many others maybe it is.

The thing that's counterintuitive about the default for VB arrays, if I remember right, is that the lower bound is 0 and you're specifying the upper bound, not the length. In C/C++, the lower bound is zero and you specify the length. In Fortran, the lower bound is one and what you specify doubles as the length and the upper bound.

I don't think it's inherited from BASIC because, IIRC, the default there
was always 1, where the only allowed alternative was 0. (I thought that
1 was always the default in VB too, but either I'm wrong or that was
only for the earliest versions of VB.)


6. Juvenile bit without a point.

I guess if one had even tried one would get his point. (I tried once...)

It's a vague swipe at the things VB doesn't have without actually making a specific point. I've seldom found the lack of true inheritance to be limiting, and there are aspects of the VB object model that I rather like.

11. A complaint revolving around the Value property of a checkbox, which
the author apparently doesn't understand is not a boolean.

So? Then perhaps it really should be a complaint about which type this
checkbox thing should really be. Boolean is the natural assumption for
something that either HAS or HAS NOT a checkmark.

There's a third possibility, though, which is neither checked nor unchecked, the greyed thing you can get when it's a parent for multiple child options and checked is all children checked, unchecked is no children checked, and greyed is some children checked, some unchecked.
(I believe that's why the Value property on a checkbox is enumerated 0, 1, 2 rather than boolean True, False.)

Anyway, allowing a
boolean operator (Not) to work on something that isn't boolean without
either a consistent conversion to boolean, OR a compiler error for the
non-existence of such a conversion rule, is also an Bad Thing [tm] IMHO.

VB's logic is arithmatic throughout... the operators are all bitwise. When used in a logical context, nonzero is logical truth and zero is logical falsehood. It'd be like if you didn't have the && or || operators in C.

The tricky thing is that, because it's bitwise (and twos complement), Not 1 is something large and negative. Not -1 is 0.

(This is something that's come under discussion in this group before in the context of conversion from LOGICAL to integral types.)
.



Relevant Pages

  • Re: working with byte arrays
    ... faster than my current solution because the whole comparisson is done inside ... Thanks for the hint to check the size of the arrays, ... BAs Byte) As Boolean ... > same lower bound, then these can be simplified to these... ...
    (microsoft.public.vb.general.discussion)
  • Re: working with byte arrays
    ... > My IsEqualByte just compares each byte of both arrays, ... BAs Byte) As Boolean ... same lower bound, then these can be simplified to these... ...
    (microsoft.public.vb.general.discussion)
  • Re: Array size limit ?
    ... Single dimension Zero based arrays (sometimes called vectors or ... The SZArray has a lot more functionality including sort, ... Both VB6 and VB.NET do bounds ... So for VB6 has to get the lower bound add the length to ...
    (microsoft.public.vb.general.discussion)
  • Re: unique values in an array
    ... unfortunates need only read the description of ArrayUniques in the ... In both cases you start off with 0-based 1D arrays and convert them ... 'convert single area ranges to arrays; ... 'keep original 2nd dim'n lower bound, ...
    (microsoft.public.excel.programming)
  • Re: yet another another wish list
    ... C# and Oberon only support zero-based arrays ... By new programmers, I mean programmers whose first introduction to ... of an arbitrary lower bound hardly provides any additional expressive power. ...
    (borland.public.delphi.non-technical)