Static Members

S

scorpion53061

Hi All,

Is it possible this conversation has run its course and it may be time to
move on?
 
O

One Handed Man [ OHM# ]

Hi Cor,

No disrespect meant.

I didnt say that you said "anything". What I did say was that
you didnt give a cogent argument for this functionality. And
as far as I see it, you have not.

Regards - OHM
 
T

Tom Leylan

don't be so picky... Don and Cor both know what each other meant...

you see how annoying your messages can be :)
 
C

Cor

OHM,

I thought that I even saw it yesterday in a message thread and it did cost
me some extra time to understand the code. (To be true I did only slightly
look at what you where talking about, because I did agree with the
arguments).

But I only agree that it should not be used

When I saw that you said "prevented from" than I did disagree and I did not
use more arguments in this long thread.

Because I find it one of the charms from VB.net that it gives such a lot of
personal responsibility.

We both live in the EU which gives us responsibility. But there are more
countries in the world and in that countries is another behaviour and
therefore I am glad that I am from the EU and will defend that also.

Cor

..
 
H

Herfried K. Wagner [MVP]

* Jon Skeet said:
Separating == from = adds clarity - it makes it very easy to see the
difference between an assignment and a comparison. If there were two
different characters for the two different ideas, that would be even
better, IMO.

Mhm... I /never/ had a problem with the overloaded '=' operator in
BASIC/VB/VB.NET. I don't think that a lot of people had problems with
that and/or wrote "buggy" code because of the two meanings of '='.

Just my 2 Euro-cents.
 
H

Herfried K. Wagner [MVP]

* "Cor said:
I have only said that I disagree with the idea changing a program language
for a in my eyes seldom used situation.

Full ACK. If it's a problem, the real problem -- the programmer sitting
in front of the computer -- should be changed. Not the flexible
programming language.
There are people who want people not allow to drive in a car because that
can give accidents, do you want me to tell why I will allow to drive in a
car while I know it gives accidents. Altough accidents are not seldom.

Full ACK.
 
H

Herfried K. Wagner [MVP]

* Jon Skeet said:
But that's what the thread is about. This thread is *not* about "VB.NET
is better than C#" or vice versa. It's discussing whether or not the
single language "feature" of VB.NET allowing static member access
through an instance is a good idea or not.

As a VB.NET programmer, I think it's a good idea. That's my subjective
optinion, I know. And I am not able to clearly state /why/ it's my
opinion. But that doesn't matter.

A diskussion based on "facts" doesn't make sense (IMO) in this case.
I wasn't trying to extrapolate from this one VB.NET "feature" to VB.NET
itself - and no-one else in this thread has, as far as I can see.

Mhm... IMO it's only possible to understand /why/ a particular feature
is part of the programming language when having a look at the whole
programming language and the motivations and paradigms behind it.
VB.NET provides code-based RAD, by allowing to call a shared member by
an instance (which is semantically correct in VB.NET because of the
changed meaning ("static" -> "shared") it makes programming easier.
It's a shortcut. Maybe a dirty shortcut. Who cares?
 
T

Tom Leylan

Herfried,

Jon appears to be trying to educate people by mentioning a known fact. The
overloaded = operator is "known" to be a source of problems. This doesn't
mean that you ever once made the error (of course not) but when language
developers surveyed language users it turned out it was a source of errors.

But if it has never been a source of confusion why do you imagine that the
language developers separated them? Nothing else to do?
 
O

One Handed Man [ OHM# ]

Tut, Tut, your being so trite.

:))

OHM

Tom said:
don't be so picky... Don and Cor both know what each other meant...

you see how annoying your messages can be :)
 
H

Herfried K. Wagner [MVP]

* "Tom Leylan said:
Jon appears to be trying to educate people by mentioning a known fact. The
overloaded = operator is "known" to be a source of problems. This doesn't
mean that you ever once made the error (of course not) but when language
developers surveyed language users it turned out it was a source of errors.

"known fact"... Driving a car can cause an accident. That's a known
fact too. Nevertheless, it doesn't make sense to forbid driving a car
and forcing people to use public transport systems instead. There are
lots of tools available in the world which make solving a problem easier
-- sometimes they have certain disadvantages if the person who uses them
isn't able to use them.
But if it has never been a source of confusion why do you imagine that the
language developers separated them? Nothing else to do?

Mhm... They wanted to make a useless separation in order to make their
work easier.
 
O

One Handed Man [ OHM# ]

You too !


"known fact"... Driving a car can cause an accident. That's a known
fact too. Nevertheless, it doesn't make sense to forbid driving a car
and forcing people to use public transport systems instead. There are
lots of tools available in the world which make solving a problem
easier -- sometimes they have certain disadvantages if the person who
uses them isn't able to use them.


Mhm... They wanted to make a useless separation in order to make
their work easier.
 
T

Tom Leylan

I was going to ask if you had ever taken a debate course but it's obvious
you haven't.

The concepts behind driving a car and the design of a language are
completely different. The similarity (if you insist on trying to draw
parallels) is that they have added all manner of safety features since the
car was invented for one reason "it was proven to be dangerous"... that's
why the cabs are largely crush-proof, there is firewall, seatbelts are
required, turn signals were added, the gasoline you can put in it is
regulated and oh, yeah... a license (and insurance) is required to operate
one.

And if you were to take even a casual stroll through a hardware store
"prior" to attempting to convince people through lame arguments you would
see that all of the tools you are talking about have safety features added.
They were added because people inadvertantly (through normal use) could hurt
themselves or others. I'm sure you were there to argue that there is no
reason for circuit breakers on electrical things... you've never had an
electrical short and burned your house down. The less intelligent masses
(the entire rest of the world, btw) however has concluded there is a good
reason to attempt to reduce the number of problems through careful design.
Mhm... They wanted to make a useless separation in order to make their
work easier.

Would you consider not being a complete ass?
 
H

Herfried K. Wagner [MVP]

* "Tom Leylan said:
The concepts behind driving a car and the design of a language are
completely different. The similarity (if you insist on trying to draw

I would say that both of them -- the programming language and the car --
are tools created to solve a "problem".
parallels) is that they have added all manner of safety features since the
car was invented for one reason "it was proven to be dangerous"... that's
why the cabs are largely crush-proof, there is firewall, seatbelts are

That's an interesting point.
required, turn signals were added, the gasoline you can put in it is
regulated and oh, yeah... a license (and insurance) is required to operate
one.

IMO there is still at least one big difference. I will explain my point
of view:

In VB.NET, and that's a difference to other programming languages,
static members are semantically not members which only belong to the
class and not to an instance, they are instead members which belong to
/all/ instances of a class. That's a big and IMO very fundamental
difference. Thus, it's incorrect to try to apply a point of view which
is common to other programming languages onto a different programming
language. Only because it's different, it's not bad. Only because
somebody is not familiar with something, and consequently doesn't know
how to use it, it's not bad (by definition).

I never saw a professional (I don't claim to be one) programmer making a
mistake because of this feature of VB.NET. If I saw code making use of
the feature /and/ working incorrect, I knew that the person who wrote it
was not a professional. I often see beginners using this feature in a
wrong way. Yes, that's a fact and it's sometimes annoying if you have
to explain to a beginner why he /should not/ use this feature unless he
is sure that he understood it.

It's a dangerous tool, nobody doubts that. But it's a useful tool.
And if you were to take even a casual stroll through a hardware store
"prior" to attempting to convince people through lame arguments you would
see that all of the tools you are talking about have safety features added.

..NET has its safety features added too. Visual Basic .NET has its
"safety" features too. And it has a box filled with advanced tools
which should not be used by beginners -- they are for use by "Gods"
only. I would not access a shared member by using an instance variable
(there are /some very rare cases/ in which I prefer to do that to avoid using
reflection), but I would not tell somebody to do that. Nevertheless, I
know that it's possible. I know why I don't use it. It's like a
weapon. It's something you must use carefully.
They were added because people inadvertantly (through normal use) could hurt
themselves or others.

Don't tell me that a professional programmer will access a shared member
through an instance member "accidentially". Maybe an option to hide
shared members when accessing properties/methods of an object in the
code editor would be fine.
 
T

Tom Leylan

Herfried K. Wagner said:
I would say that both of them -- the programming language and the car --
are tools created to solve a "problem".

They are also both composed of atoms... using a car as a metaphor for
computer programming doesn't work. They are trying to solve "different
problems" and with that comes a different set of criteria when weighing
alternative actions. You may as well argue that near lethal doses of
radiation should be given to "everybody" because "it can cure cancer in
some."
Only because it's different, it's not bad. Only because
somebody is not familiar with something, and consequently doesn't know
how to use it, it's not bad (by definition).

That's perfectly normal and nobody has suggested (ever) that "different is
bad." So you are correct. The thread clearly points out that "confusion"
exists. As a general rule language developers try to reduce confusion. I
note the following from a posting back in Sep. 2000...

<begin quote>
Another survey question for you all, if you are interested:

As you may know, in JScript.NET we have support for classes, including
static members. One thing that we (the ECMA committee) needs to decide is
whether static members can be seen from instances.
<end quote>

that demonstrates that the ECMA committee was at least "considering" whether
one methodology or another would be less confusing. Note that nowhere has
anybody suggested it should "be okay to be different" ... their concern was
(likely) not about the personal feelings of a single user but rather a large
sense of eliminating (as best one can) confusion about things that are
already confusing to many.
I never saw a professional (I don't claim to be one) programmer making a
mistake because of this feature of VB.NET. If I saw code making use of
the feature /and/ working incorrect, I knew that the person who wrote it
was not a professional. I often see beginners using this feature in a
wrong way. Yes, that's a fact and it's sometimes annoying if you have
to explain to a beginner why he /should not/ use this feature unless he
is sure that he understood it.

Whether you actually see something isn't the gauge is it? It isn't much of
a reach to "know" that programmer's do it. And it doesn't mean they aren't
professional. They might be sloppy or perhaps just careless... or it might
mean they just don't see the problem. You make it sound like programmers
come in two flavors. What if they have programmed incredible software for
years and yet reference the static variable this way? Are you going to
scream "hey you're not a professional" well no need to answer that I'm
certain I can guess :)
It's a dangerous tool, nobody doubts that. But it's a useful tool.

It isn't particularly dangerous and it isn't particularly useful at all (or
perhaps you are describing something else.) Did you read the thread? It
used the word "confusing."
.NET has its safety features added too. Visual Basic .NET has its
"safety" features too. And it has a box filled with advanced tools
which should not be used by beginners -- they are for use by "Gods"
only.

Well I'll bite... which advanced tools should not be used by beginners? And
where do you administer the tests so they know when they use them? Again
(and always again Herfried (search any thread we have ever had)) you aren't
answering questions, you are defending an undefendable position you have
taken. Advanced tools (whatever your definition of that might be) aren't
"advanced" because they are especially dangerous. Gosh you yourself used a
car as an example... do you not consider that an advanced tool? Aren't cars
used by beginners? Aren't cars used by old folks, the nearly blind, the
habitually drunk, the teenager on a cell-phone? You want to prevent
somebody from using a datagrid or is the FTP component you think they need
special training on?
Don't tell me that a professional programmer will access a shared member
through an instance member "accidentially". Maybe an option to hide
shared members when accessing properties/methods of an object in the
code editor would be fine.

Well maybe you can get on the committee... you seem eminently qualified.
And oh gosh "professional programmer" never... that knowledge comes with the
gold patch that says "I'm a professional programmer" and then they take that
oath and stuff.

It's the semi-professional, quasi-professional, sub-professional, and
pseudo-professionals I spend my nights worrying about.... what on Earth are
you talking about? Have you ever ventured into a room with people in it?
Do you live in PerfectVille? Don't get down off that mountain, the world as
it is will scare you to death.

As always this has been a useless pursuit... you seem to care too much about
your perceived status as an expert to ever have a sane conversation.
 
C

Cor

Hi Tom,

Maybe I did see it wrong, but I did not use a car accident as a metaphor for
a program error.
There are people who want people not allow to drive in a car because that
can give accidents, do you want me to tell why I will allow to drive in a
car while I know it gives accidents. Altough accidents are not seldom.

I try only to tell that the accident itself had nothing to do in this
discussion.
The metaphor was if I should be the one who had to prove that there would
not be an accident, while that was not my point.

(And then in the methaphor every accident, not only the big ones you are
talking about)

In my opinion you did change very much my the words Tom.

Or are you talking about the continuation from Herfried?

Cor
 
H

Herfried K. Wagner [MVP]

* "Cor said:
Maybe I did see it wrong, but I did not use a car accident as a metaphor for
a program error.

Nobody did that. I only compared making a programming mistake because
of accesing a shared member through an instance variable with making a
car accident by misusing the car.
In my opinion you did change very much my the words Tom.

Or are you talking about the continuation from Herfried?

Sorry, I don't understand you again...
 
H

Herfried K. Wagner [MVP]

* "Tom Leylan said:
They are also both composed of atoms... using a car as a metaphor for
computer programming doesn't work. They are trying to solve "different
problems" and with that comes a different set of criteria when weighing
alternative actions. You may as well argue that near lethal doses of
radiation should be given to "everybody" because "it can cure cancer in
some."

/You/ said that... I still don't get the point. Why not eliminate
recursion? It can cause stack overflows when used by people who don't
know how to properly use it. There are lots of other samples I can
think of which can cause errors by misusing them. That's not a reason
for forbidding them. Some tools should be used carefully, I already
said that.
That's perfectly normal and nobody has suggested (ever) that "different is
bad." So you are correct. The thread clearly points out that "confusion"
exists.

For /me/, this confusion never existed. I never used instance members
to access shared members. So it's not a problem for me. I don't have
any problem with the fact that this "feature" exists. If other people
have problems with it, they just should not use it. Removing a feature
only because its often misused is IMHO the wrong way.
As a general rule language developers try to reduce confusion. I

Who says that this "general rule" must apply to every programming
language? Is a programming language worse than an other if it breaks
the rule but consequently allows the programmer to be faster (or
whatever)? As a result, the programming language may not be perfect for
people who don't know how to use a tool carefully. Those who know how
to do that, will be more productive.
Another survey question for you all, if you are interested:

As you may know, in JScript.NET we have support for classes, including
static members. One thing that we (the ECMA committee) needs to decide is
whether static members can be seen from instances.
<end quote>

ACK. It's point of discussion for languages which want "clearity".
BASIC never used to be such a language. And it never claimed to be such
a language. My giving up this basic principle of BASIC, we would not
need VB.NET.
Whether you actually see something isn't the gauge is it? It isn't much of
a reach to "know" that programmer's do it.

I don't /know/ programmers who use this feature. That's why I don't
/know/ that programmers make a mistake by misusing this feature.
And it doesn't mean they aren't professional.

It's hard to realize, but its a fact. Programmers who don't even know
the language specs and the behavior of language constructs they use, I
wouldn't call to be "professional".
They might be sloppy or perhaps just careless... or it might

Is a careless programmer really a professional programmer? Is a
careless car driver really a professional car driver? I don't think so.
mean they just don't see the problem. You make it sound like programmers
come in two flavors. What if they have programmed incredible software for
years and yet reference the static variable this way?

Then they are not professional VB.NET developers. If I use a tool, I
try to understand what it does.
Are you going to scream "hey you're not a professional" well no need
to answer that I'm certain I can guess :)
:)


It isn't particularly dangerous and it isn't particularly useful at all (or
perhaps you are describing something else.) Did you read the thread? It
used the word "confusing."

I read the thread, and I don't have a problem with a certain amount of
what you call "confusion" (see above why not).
Well I'll bite... which advanced tools should not be used by beginners? And
where do you administer the tests so they know when they use them? Again
(and always again Herfried (search any thread we have ever had)) you aren't
answering questions, you are defending an undefendable position you have
taken.

I know I am doing the latter. From your point of view it may look
undefendable. I don't doubt that. Nevertheless, I "fight" for the
BASIC in the VB.NET programming language, you seem to fight for
principles in the language which are available in other programming
languages.
Advanced tools (whatever your definition of that might be) aren't
"advanced" because they are especially dangerous. Gosh you yourself used a
car as an example... do you not consider that an advanced tool? Aren't cars
used by beginners? Aren't cars used by old folks, the nearly blind, the
habitually drunk, the teenager on a cell-phone? You want to prevent
somebody from using a datagrid or is the FTP component you think they need
special training on?

I remember that there was a driving license (at least in Austria, where
I live).
 
C

Cor

Hi Herfried,

It was ment for Tom, but you are right, this is a ten times corrected
message and than you see those terrible changing mistakes afterwards.
messages that you did with Herfried?

(Just to give Tom a nice friendly escape, words are not always as strict as
C#)

:))

However I was looking for you yesterday, thought that we had the same idea
about this.
But there were not much I had to fight against and sometimes I love it like
yesterday.

:)

Cor
 
H

Herfried K. Wagner [MVP]

* "Cor said:
(Just to give Tom a nice friendly escape, words are not always as strict as
C#)

:))
;-)))

However I was looking for you yesterday, thought that we had the same idea
about this.
But there were not much I had to fight against and sometimes I love it like
yesterday.

Sorry, it was a really annoying day yesterday. Some of my messages were
not posted and I don't have a copy of them any more.

:-(
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top