Re: Global Functions

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



Branco,

I absolutely do not agree the part that you write about "Static". There is a
static keyword in VB, and that describes what it does (although logically
not technical).

The Shared keyword describes in my idea much better logical what it does
than the Static keyword in C#. In my opinion in the word Static in C# just a
piece of legacy.

Therefore let us not change the facts because the people using C derived
languages tells.

To give an anology: Worldwide Coffee describes much better what we are
drinking than as it is in the jargon from C people.

Java is for me an island from Indonesia. Coffee is a drink from a bean that
long ago was smuggled from Brazil by Dutch people to Java where they started
to cultivate it.

The rest of your text we agree about, but that you knew probably already.

:-)

Just my thought,

Cor


"Branco Medeiros" <branco.medeiros@xxxxxxxxx> schreef in bericht
news:1166471796.055776.180170@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Tom Leylan wrote:
<snip>
There are
times when the extra syntax needed to create a module-like class just
gets in the way.

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.


Yep, the C# 2.0 folks would do that, allright. They'd say "Look, they
call static classes a 'module'!". =)))

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).

<snip>
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).

<snip>
Most people's mileage is likely to differ :-)

This, I fully aggree.

Regards,

Branco.



.



Relevant Pages

  • Re: Head-in-the-Sand Liberals (LA Times Columnist)
    ... You claimed to have known several computer languages, ... If you lie about knowing computer languages, ... of the programming loop for a functional ... You also don't know Java. ...
    (rec.org.mensa)
  • Re: How come Ada isnt more popular?
    ... Most programming languages were terrible at that time, ... And we talked about "Why isn't Ada more popular?". ... Adopting Java ...
    (comp.lang.ada)
  • Re: Arithmetic overflow checking
    ... That simplifies some electrical engineering ... numbers I'd likely skip Java as a candidate for doing that work. ... Just as when I was doing primarily scientific programming ... Another interesting consideration is languages that have type systems ...
    (comp.lang.java.programmer)
  • Re: performance question
    ... that let me mix different programming styles more freely. ... When I started learning Java, my biggest problem was that I ... I've noticed that people often prefer to take shortcuts when writing code - ... deficiencies in the model and/or the existing languages that implement ...
    (comp.lang.java.programmer)
  • Re: Bloody Java again
    ... I passed my Java exams last year but really have ... Erlang's concurrent programming is rather abstract and high-level. ... He is not being asked to grade umpteenth different languages. ... Student: "It's all in the program, ...
    (comp.lang.functional)