Re: Poor VB Programming
From: Mark J. McGinty (mmcginty_at_spamfromyou.com)
Date: 09/25/04
- Next message: Peter Plumber: "Re: debug.print caused VB-Crash"
- Previous message: J French: "Re: Unsigned 32 bit"
- In reply to: Ralph: "Re: Poor VB Programming"
- Next in thread: Larry Serflaten: "Re: Poor VB Programming"
- Reply: Larry Serflaten: "Re: Poor VB Programming"
- Reply: Bob Butler: "Re: Poor VB Programming"
- Reply: Ralph: "Re: Poor VB Programming"
- Messages sorted by: [ date ] [ thread ]
Date: Sat, 25 Sep 2004 02:45:52 -0700
"Ralph" <msnews.20.nt_consulting32@spamgourmet.com> wrote in message
news:edciSRpoEHA.3428@TK2MSFTNGP11.phx.gbl...
>
[snip]
>>
>> How in the hell can a language allow redefinition of internal symbols?!
>> I
>> am shocked and amazed... So one module with a few insanely written lines
>> could make an entire project utterly nightmarish:
>>
>> Public Load As String
>> Public Unload As Long
>> Public App As Single
>> Public Forms As Integer
>> Const InStr = "reality was stolen, sanity has no meaning, welcome to
> the
>> twilight zone"
>>
>> I think I'm going to script a regexp search for any declaration syntax,
>> using each reserved word, before I accept even one more existing VB code
>> base as a project!
>>
>> My mind is blown... seriously!
>>
>> -Mark
>>
>
> If you are talking about "Now()", then don't get too upset as it is not an
> "internal symbol" - it is a Function that returns a Date Variant. There is
> a
> quirk in VB that allows functions that don't take parameters to not
> require
> the parentheses.
A function is a symbol. Now is part of the VB runtime, is it not? Seems
pretty internal to me... perhaps not the best choice of words, but still not
fundamentally inaccurate.
> Almost all languages allow you to redefine library procedures - at your
> own
> risk of course - but allowed.
Yes that's true but most won't allow you to do it by accident. C will not
allow you to declare a given "symbol" (as in function or variable
identifier, represented by the linker in the "symbol table", thus my
tendency to use the word "symbol") more than once in the same scope, so if
you want to replace a runtime function you must omit the lib in which it
resides from the link list.
T-SQL will not allow you to name a user variable that starts with @@, that
prefix is reserved for system variables, sometimes referred to as "internal"
because they are a built-in part of the environment.
C++ is somewhat more flexible, it that it will allow you to redefine
arithmetic operators in some cases, but not everything in C++ is
overridable, there are rules, it'd be pretty difficult to override something
by accident.
For VB to allow this is inconsistent, it won't let you name two public
functions or subs the same thing within a project, to do so causes an
"ambiguous name detected" error. Clearly standard runtime functions share
the same namespace, why is it less than ambiguous to redefine one of them?
-Mark
- Next message: Peter Plumber: "Re: debug.print caused VB-Crash"
- Previous message: J French: "Re: Unsigned 32 bit"
- In reply to: Ralph: "Re: Poor VB Programming"
- Next in thread: Larry Serflaten: "Re: Poor VB Programming"
- Reply: Larry Serflaten: "Re: Poor VB Programming"
- Reply: Bob Butler: "Re: Poor VB Programming"
- Reply: Ralph: "Re: Poor VB Programming"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|