Tom Leylan wrote:
I'm not arguing mind you but perhaps you could illustrate one of those
times.
I guess this actual thread illustrates such a case.
My point in most of these discussions (regardless of the language)
is to ask why then haven't other languages adopted this really cool thing?
More dramatically if dBASE has a CLEAR ALL command which removes all
variables from memory (and it was a "good" feature rather than a horrid one)
why wouldn't the developers using C, Pascal, VB and such be begging for it?
This is not the point. It seems that every important -- some of them
even cool -- models of computation was already done with by now; modern
language developers are mostly adapting features and stealing sugar.
But languages sometimes don't borrow from one-another even when
something is "cool". Mostly there's a philosophy issue behind the
scenes. Maybe the "stealing" exists, but it's so subtle you can't even
see it's there. How many things Basic (and even VB) stole from Fortran?
How much Java stole from VB? (look very close and you'll see a lot). As
for "clear all", I kinda recall MSX-Basic (from Microsoft breed) had
something like that to clear the garbage collector allocated space,
back in, what, the 80s? C'mon...
I admire people who can code in Perl, and I'm not one of them. Not that
I lack the expertise, mind you, I really believe I can be an
average-to-good programmer in most programming languages (something
laughed here inside myself, but don't listen to it). I don't code in
Perl because the language doesn't appeal to me. VB, on the other side,
is cool in me, and I'm glad Modules have survived the transition to OOP
without becoming a hack. I'd rather declare a Module -- something the
VB programmer will immediatly recognize for what it is -- than to come
up with solutions such as having a shared Singleton() method in a final
class with a private constructor... Not that I'm saying I won't use
that, only that I preffer not to. On the other side, a public
ConnectDB() method inside a module will immediatly make it clear to me
that it's the global scope speaking.
This is the part I don't understand. I have static classes in VB and I have
no modules so what am I missing? Why not eliminate the keyword CLASS from
VB and just call them all MODULE? I think it depends upon one's goal and
increasing the differences between languages shouldn't be a goal. If a
keyword is available in C# and in VB I see no reason to change one of them
in an effort to make things harder. I wouldn't add curly braces to VB but I
can't see using new words to describe common concepts. All I'm saying is if
a module is a static class what is the difficulty in calling them a static
class?
You're talking about the C# folks, right? Why they didn't call a static
class simply a module, right? Because, AFAIK, the module "concept"
existed in VB long before the C# folks noticed it. Nevertheless, a
couple of most likely reasons to why "static classes" are called Module
in VB: a) because the term "static" in VB has a very specific meaning,
different from the ones it has in C#/C++/Java/C: in such languages,
"static" inside a function declaration means the same as in VB: that
the variable is, er, static (i.e. preserved between calls). Outside a
function declaration, it designate elements shared by all instances of
a class (quite a different meaning, I guess you'll aggree). In VB, by
its turn, a method can be Static, which means that all its internal
variables are static. If you want the C# meaning you must use the term
"Shared". b) because the term "Module" already existed to represent the
exact same thing as C#'s "static class".
To be honest, I'm kinda proud of those keywords that represent
concepts that VB pioneered -- or at least brought to the general
knowledge -- and that were taken hold by other languages, sometimes
having their names changed to cover the evidenc... er, I mean, to suit
the language better, such as For Each, Event (for event-driven
programming), Interface, Module, etc.
This doesn't mean I even *like* those keywords VB invented to represent
concepts already stablished in the programming field (MustInherit and
NotInheritable to name a few).
You can hide it anywhere you like but I haven't used a single module and I'm
not finding things harder to use or taking longer to write. I don't see the
upside and I see lots of downside to modules. I also don't see anything
wrong (from a language standpoint) with Java.
Ahw, sure. I just don't sympathize with that guy Scott. Taking that,
Java is ok to me. My point was that there's already A-Way-To-Do-IT (tm)
in VB, I'll use Java's way only if there's no VB way (or if the Java
way is more close to my liking. I'm a bitch, I know).
Notice that Java recently was given Properties, Enums and ForEach, and
two of those were practically born with VB (well, ForEach was born with
Pearl, and Properties were created by TurboPascal, to be exact, but I
doubt they'd have any importance if it wasn't for VB... After all, VB's
ForEach gave headaches to more than one C++ developer when it came to
programming IDispatch interfaces. Now every language demands a foreach
construct, but they should name it "VBForEach", to be honest. Nope,
just kidding, strike that).
Most people's mileage is likely to differ
This, I fully aggree.
Regards,
Branco.