Why
I dislike VisualBASIC
6
Note that some of these statements may
or may not apply to
VisualBASIC.net:
Bad
Things
- The editor forces capitalization rules onto the programmer, which
can be considered as a good thing (regarding consistency), unless it
forces initial capitals onto the programmer which make reserved words
indistinguishable from other words in the code when viewed in a editor
without highlighting capabilities.
- The editor seems to insert the End Sub and
End
Function text
for me, I got used to it, but these things should never ever be forced
upon anybody without making the feature (erhm) optional?
- The editor also seems adamant on having a single space between
the assignment operator (and it's left-, right- values), which makes
the following impossible, and impedes source code readability quite
massively:
Public Const
MyStupidConst = 1
Public Const
MySecondStupidConst = 2
Public Const
MyEvenMoreStupidConst = 4
- The source code for the forms is stored in the '.frm' file, which
unnecessarily mixes form and functionality (i.e., interface design and
code).
- Modules in VisualBASIC can access each others public subs,
functions
and variables without any clear notion of hierarchy or dependancy.
- The use of a keyword As to
assign datatypes to variables. The
more common equal sign '=',
presents
a visual que, which is now missing, and thus decreases source code
readability.
- It doesn't use ';'
characters as end-of-line identifiers. For short
lines it's no problem, but using a continue-line character like '_' just
looks
butt ugly.
- Array declaration by using a '*'
multiplication characters looks
very confusing. (Weird: They do use a '&' for
string concatenation to
remove confusion, then intentionally confuse people with this, a
designer with multiple personality syndrome?)
- The language is limited in datatypes, it seems to be incapable of
handling unsigned numbers, which can be a show stopper when doing
system level programming.
- It allows untyped variables, well actually Variants (but it's
more or less the same thing). Beside bad practice, Variants also use
gobbs of unnecessary memory.
- Old school console screen IO seems impossible (at least without
making direct Win32 API calls), apparently some wanker probably decided
it wasn't necessary anymore. (Oh well 640K should be enough for
everybody, right?)
- Still uses labels and 'On Error GoTo'
constructs. This is really pityfull in modern day and age. For crying
out loud, this was considered bad practice even three decades ago!
There
was a time in which people were lynched for using 'GoTo'
statements. And they still should be... The concept of exceptions was
introduced into Ada back in 1983, so lack of better options is no
excuse at all.
- Calling Subs of Function is not the same, with Subs I can use MySub
MyParam, and with functions it's like this MyVar =
MyFunction(MyParam), I don't see the point.
- It's the least portable language in existance because there only
is one full implementation of it, even if other vendors would want to
implement it, there is no (internationally) accepted (ISO, ANSI, ECMA)
standards document about VisualBASIC.
- It allows programmers to declare variables wherever they need
them, fueling bad programming practices amongst novice programmers.
- It has no clear object hierarchy, which basically means it's a
mess.
Good
Things
- It uses a '&' character to differentiate between string
concatenation and mathematical addition. It's a bit awkward at first
though.
- The debugger is very easy and smooth, though implementation must
have been easy in VisualBASIC 6, since the language still is
interpreted in development mode.
- the 'if
.. end if' construction shows clearly which end
statement belongs to which previous statement, which improves code
readability.
-- Pascal de Bruijn (11 Jun 2005)
"Let’s say the adoption of
programming languages has very often been
somewhat accidental, and the emphasis has very often been on how easy
it is to implement the programming language rather than on its actual
merits and features. For instance, Basic would never have surfaced
because there was always a language better than Basic for that
purpose."
-- Alan Kay (ACM
Queue vol. 2, no. 9 - Dec/Jan 2004-2005)