What is the equivalent to the namespace My from VB in c#?

  • Thread starter Bruno Neves Pires Silva
  • Start date
B

Bruno Neves Pires Silva

Hello, programmers.

What is the equivalent to the namespace My from VB in c#?


Thanks in advance
 
C

Cor Ligthert[MVP]

Mark,

This namespace did not exist in VB.Net it was only in VB 2005 and VB 2008.

VB.Net is the name in version 2002 and 2003 where the My namespace was not
included.

It became a kind of help for VB6 developers migrating to Net because it
looked that they had problems with instancing classes.
(But it is in some cases a very handy namespace as it comes to things as
environment variables)

Like you wrote, "training wheels"

Cor
 
J

Jeroen Mostert

Mark said:
VB.NET "training wheels"...
I think the "My" namespace is a marvelous invention that both cuts down on
development time and makes programs more readable. It's an excellent
application of the Facade pattern.

Training wheels are things you discard. There'd be no need to discard any
use of the "My" namespace -- you would directly use the appropriate BCL
classes only if "My" has no support for your scenario because it's not as
common (and it covers a *lot* of scenarios). So the only relevant criticism
here is that there shouldn't be two ways to accomplish the same thing -- but
then, that ship sailed for C# as well when LINQ was introduced.

Soapboxing ends. I love defending VB against C# programmers, even though I'm
primarily a C# programmer myself; there's really not enough love across the
cultural divide.
 
C

Cor Ligthert[MVP]

Jeroen,

The My namespace is only available as static and using static members is
something I always try to avoid.

Maybe it is a personal preference, but it is like that.
I love defending VB against C# programmers, even though I'm primarily a C#
programmer myself; there's really not enough love across the cultural
divide

Mark has showed already how the namespace My can be standard used in C#.
It is a namespace existing in Net 2.0 and later.

It is simple Net developing. VB, C# and C++ are just kind of glues to
construct an application with that.

I don't see what love has to do with this.

Cor






Cor
 
J

Jeroen Mostert

Cor said:
The My namespace is only available as static and using static members is
something I always try to avoid.
Yes, we've all been taught that's not O-O. Then again, that's not the point
of the My namespace.
Mark has showed already how the namespace My can be standard used in C#.

The point is that it's a quintessentially VB thing, not that it can't be
used from other .NET languages. That said, support from C# is clumsy at
best. It appeals to your preference for avoiding static methods, though.
It is simple Net developing. VB, C# and C++ are just kind of glues to construct an application with that.
Only if your application is particularly simple and uninteresting. Then
again, there is indeed a lot of demand for such applications, so it's a good
thing the need is served.
 
J

Jeff Johnson

Soapboxing ends. I love defending VB against C# programmers, even though
I'm primarily a C# programmer myself; there's really not enough love
across the cultural divide.

I came to C# from VB6, and I'll happily defend VB<number> from the C[symbol]
snobs, but in this case I agree with the "training wheels" sentiment. .NET
was a great time for VB to shed its image of being a toy language, but the
inclusion of toy boxes makes that hard to do.
 
J

Jeroen Mostert

Jeff said:
Soapboxing ends. I love defending VB against C# programmers, even though
I'm primarily a C# programmer myself; there's really not enough love
across the cultural divide.

I came to C# from VB6, and I'll happily defend VB<number> from the C[symbol]
snobs, but in this case I agree with the "training wheels" sentiment. .NET
was a great time for VB to shed its image of being a toy language, but the
inclusion of toy boxes makes that hard to do.
It would make a lot more sense for VB to actively cultivate its image of a
toy language than to try and compete with C# on its own turf image-wise,
which is a losing premise to begin with. Heck, it's a BASIC!

Things like the My namespace, while derided by programmers who "know the
entire BCL and don't need such crutches thank you very much" *do* serve a
need, one C# doesn't serve. The .NET editions of VB are absolutely not
comparable to VB6 and predecessors in this regard, as such "toys" don't
sacrifice any of the .NET benefits gained earlier.
 
C

Cor Ligthert[MVP]

Jeroen,

Why are you speaking in this newsgroup solely about VB for Net as a toy
language.

Probably you see making games as something simple.
I have to disapprove you, it is not, while this is mostly done with C type
program languages.

When the My namespace came it was not liked by most VB Net developers as
something they did need the most, it was to make the path for the VB6
developer more smooth.

Therefore the correct use of the sample "training wheels" by Mark.

I get the idea that you make from something which comes from your own mint a
kind of science.

The VB language has not changed very much after version 1 (Goto and things
like that are removed and things are made more consequent)

The important change by version 7 was that it became a managed language
which was using Net with completely intermixable DLL's with other managed
Net languages.

This was not done for C++ where there was an extra created plus even C#
(Which looks more like Java).

That is the main reason for many old VB6 developers that they feel
themselves discriminated.

They would have been more happy as it had been something like V#.

But in contradiction to your message. The language VB did not change so
much, there was done very much to keep it the same, and that is often a
reason to keep the name the same.

But please let us close this discussion, this is not a VB newsgroup.

Cor
 
J

Jeroen Mostert

Cor said:
Why are you speaking in this newsgroup solely about VB for Net as a toy
language.
I wasn't, I was talking about its *image* as such.

The rest of your post is pretty much preaching to the choir, and you even
manage to ascribe to me some of the attitudes I'm explicitly railing against.
But please let us close this discussion, this is not a VB newsgroup.
By *all* means.
 

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