Microsoft.VisualBasic.Left Function

  • Thread starter Thread starter Bill McCarthy
  • Start date Start date
Exactly!


Armin Zingler said:
One reason might be that there will be less and less people who know
these functions from the VB6 (and earlier) times, and people that are
new to it probably don't find a reason to make the detour to the MSVB
namespace, which are mainly wrappers to the other Framework functions. I
have no problem if they are used, but I myself only use the good
old Msgbox function (IIRC).

I believe that future releases of the Framework won't contain the MSVB
functions anymore because they are not really necessary, but I think
this won't happen in the next 3-5 years.

Even if the features we are talking about are not in the Compatibility
namespace, they are mainly there to make it easier for the VB Clasic
people to accomodate to the managed world, and to avoid more complaints
like "everything is different now!"



Armin
 
Armin Zingler said:
One reason might be that there will be less and less people who know
these functions from the VB6 (and earlier) times, and people that are
new to it probably don't find a reason to make the detour to the MSVB
namespace, which are mainly wrappers to the other Framework functions. I
have no problem if they are used, but I myself only use the good
old Msgbox function (IIRC).

I believe that future releases of the Framework won't contain the MSVB
functions anymore because they are not really necessary, but I think
this won't happen in the next 3-5 years.

Even if the features we are talking about are not in the Compatibility
namespace, they are mainly there to make it easier for the VB Clasic
people to accomodate to the managed world, and to avoid more complaints
like "everything is different now!"

Well, one could say that even VB.NET is only contained in VS to make it
easier for the VB Classic people to acommodate to the managed world. Do you
have the fear that VB would disappear from the .NET Framework? I think
avoiding to use the function is ad-hoc pessimism.
 
Well, one could say that even VB.NET is only contained in VS to make it
easier for the VB Classic people to acommodate to the managed world.

One could also say that all programming languages exist to make it easier
for people who don't understand binary code to write programming
instructions, but how does that statement have any relevance to the point
that the legacy functions are largely a duplication of what's already in the
BCL?
Do you have the fear that VB would disappear from the .NET Framework?

I think that I've (and others) have made it clear that we do think that
portions of the VB language will dissapear, at some point, yes.
I think avoiding to use the function is ad-hoc pessimism.

Ok. But, pessimism <> bad thing. After all, have you ever used pessimistic
record locking? :)

-Scott
 
Herfried K. Wagner said:
Well, one could say that even VB.NET is only contained in VS to make
it easier for the VB Classic people to acommodate to the managed
world.

I think that's even true. (Why have different languages? Why are there
different car brands?)
However, dropping the whole VB is not comparable to dropping these
functions because it's only a (minor) subset of the whole package.
Do you have the fear that VB would disappear from the .NET
Framework?

I don't have any fears because I didn't give an evaluation of these
functions. I only gave my interpretation why the functions are still
there and what will happen to them in the future - and maybe even VB
will even disappear one day, but that's nothing that anybody can read in
the crystal ball this day.
I think avoiding to use the function is ad-hoc
pessimism.

Which pessimism? You mean my estimation that they will be dropped one
day? Well, I think this is the natural development because there is no
need to artifically keep alife redundant stuff that will be used less
and less in the future for the reason given. I don't think this is a bad
development. I don't think it's bad to use them now, however, every time
I teach VB noobs, I don't see a single reason to show them the MSVB
namespace.


Armin
 
Scott M. said:
One could also say that all programming languages exist to make it easier
for people who don't understand binary code to write programming
instructions, but how does that statement have any relevance to the point
that the legacy functions are largely a duplication of what's already in
the BCL?

VB is maybe a duplication of C# (the "#1 .NET programming language") which
exists only for compatibility purposes ;-).
I think that I've (and others) have made it clear that we do think that
portions of the VB language will dissapear, at some point, yes.

I have seen that for sure and I do not completely disagree because I know
how Microsoft values compatibility and "language stability". I, however, do
not share the pessimism about the future of a certain part of Visual Basic
without being pessimistic about the whole programming language. Note that I
am not pessimistic about VB's future, but I am not too optimistic too.
Ok. But, pessimism <> bad thing. After all, have you ever used
pessimistic record locking? :)

;-)
 
One could also say that all programming languages exist to make it easier
VB is maybe a duplication of C# (the "#1 .NET programming language") which
exists only for compatibility purposes ;-).

I would just say that I don't see how VB can be a duplication of C# if VB
was around first.

:)
 
Hi Armin,

Armin Zingler said:
One reason might be that there will be less and less people who know
these functions from the VB6 (and earlier) times, and people that are
new to it probably don't find a reason to make the detour to the MSVB
namespace, which are mainly wrappers to the other Framework functions. I
have no problem if they are used, but I myself only use the good
old Msgbox function (IIRC).

I believe that future releases of the Framework won't contain the MSVB
functions anymore because they are not really necessary, but I think
this won't happen in the next 3-5 years.


I don't think this will happen at all. But, there are places such as
Silverlight, wehre a cut down set of functionality will require that soem of
the VB nicities aren't there.


Even if the features we are talking about are not in the Compatibility
namespace, they are mainly there to make it easier for the VB Clasic
people to accomodate to the managed world, and to avoid more complaints
like "everything is different now!"

For the most part, yes. About the only thing I use explicitly from the VB
namespaces is ChrW. I use to remove the project wide Import, and then add :

Imports VB= Microsoft.VisualBasic

Then I could write things like VB.Left(....), but I only do that when I need
VB.ChrW wide now days.
 
Herfried,

I won't call VB Net a duplication of C#. I would more call C# a duplication
of VB with legancy semantic from C.
That in the C# world elitair words are used should not mislead us.

Or in other words. It are two languages with the same parents.

As we see the VAR now in C# (which is the modern Dim) we see that it is
even going direction to VB habits.

However in my idea is it not the language that makes VB strong, it is the
way as it can be used in Visual Studio. Where the speed of creating
assemblies with VB is far superior to C#.

You also know how careful Microsoft is with code breaking changes after VB6
to Net.

Cor
 
Bill McCarthy said:
I don't think this will happen at all. But, there are places such as
Silverlight, wehre a cut down set of functionality will require that
soem of the VB nicities aren't there.

We could make a bet and meet in 10 years. :-)
Imports VB= Microsoft.VisualBasic

Then I could write things like VB.Left(....), but I only do that when
I need VB.ChrW wide now days.

Ok, so we now have two precious functions: Msgbox and chrW. ;-)


Armin
 
Armin Zingler said:
We could make a bet and meet in 10 years. :-)


Ok, so we now have two precious functions: Msgbox and chrW. ;-)

LOL. I wasn't going to admit to using MsgBox ;)
 
Greg said:
I know I can use the Microsoft.VisualBasic.Left function to get the left
portion of a string, but I would prefer to avoid using any
Microsoft.VisualBasic namespace items. What is the equivilant in VB.Net
2005?

There's no Good Reason to throw them out completely (there are /still/
some things it really quite difficult to do /without/ them) but, given
the changes in things like indexing (zero or one-based), it may be
better to look for "purer" means.


Using Left:

Dim s2 as String = VB.Left( s1, 3 )

Using String.Substring:

If s1.Length >= 3 Then
s2 = s1.Substring( 0, 3 )
Else
s2 = String.Empty
End If

Note that Substring() is /far/ less tolerant of overrunning the end of
the source string ...

s1 = "ab"
s2 = s1.Substring( 0, 3 )

... gets you an ArgumentOutOfRangeException.

HTH,
Phill W.
 
Back
Top