Re: trim(string) vs string.trim
- From: "Al Reid" <areidjr@xxxxxxxxxxxxxxxx>
- Date: Fri, 25 Aug 2006 07:48:45 -0400
Jared wrote:
Terry,
Please note before leaving your code in place that the Trim function
is implemented in the Microsoft.VisualBasic namespace for backward
compatability. If you use Reflector you'll find that the internal
implementation begins with the following check.
If ((str Is Nothing) OrElse (str.Length = 0)) Then
Return ""
End If
Now, I realize this call does the "work" for you, but, assume you (or
someone else)wants to convert the project to another .net language.
C# for instance does not implement a global Trim() method. The
developers porting your code are then forced** to change every
reference to Trim() to either a utility function or to the native
framework methods. It's best to just conform and avoid the backward
compatible functions.
** The conversion utility may make this change for you.
"Terry Olsen" wrote:
Alright, I've been seeing people rant and rave about no using the VisualBasic namespace in a VB application and that it is there for
backward compatibility (which I don't agree with. I will agree that VisualBasic.Compatibility is). My question is this, why chose
VB as a language and then go out of your way to avoid using the features built into the language via the VisualBasic namespace. I
just don't get it. If one wants to write a c# app, why not just do it in c#? Perhaps I don't get it because I have been writing VB
apps using MS dialects of Basic since 1982. The day I stop using the VisualBasic Namespace (excluding the .Compatibility) is the
day I stop writing in VB.
Just My $0.02.
--
Al Reid
.
- References:
- trim(string) vs string.trim
- From: Terry Olsen
- Re: trim(string) vs string.trim
- From: Branco Medeiros
- Re: trim(string) vs string.trim
- From: Terry Olsen
- trim(string) vs string.trim
- Prev by Date: Re: Q: deleting relations
- Next by Date: Re: Copying my file to another location on the hard disk
- Previous by thread: Re: trim(string) vs string.trim
- Next by thread: Re: trim(string) vs string.trim
- Index(es):
Relevant Pages
|
|