Re: Checking for A Blank String
- From: "Herfried K. Wagner [MVP]" <hirf-spam-me-here@xxxxxx>
- Date: Sun, 11 Mar 2007 02:40:33 +0100
Tom --
"Tom Leylan" <tleylan@xxxxxxxxxx> schrieb:
This is not a discussion about basing preferences on ideology. I have given technical reasons why I avoid using 'String.IsNullOrEmpty' currently.
Yes and in this case you pointed out a bug. But how many other very similar discussions have we had about the VB compatibility library?
I do not specifically remember any discussions, but I believe that "Microsoft.VisualBasic.dll" is a good (stable, handy, ...) library. On the other hand, I'd not use the compatibility libraries.
If it was available in VB6 Herfried prefers to use it in VB.Net.
Again, completely wrong. Although I am currently only active in the English VB group, I use VB.NET, VB6, C#, and some other programming languages equally. When using VB.NET, I use VB.NET, not only the .NET Framework, as I do with other programming languages.
Completely wrong? It doesn't seem like that to me based upon your postings covering some 5+ years. We've discussed topics in the VB6 newsgroup and now in the VB.Net newsgroups but I don't recall reading or responding to any of your posts on a C# newsgroup.
I have never been "active" in an English-speaking VB6 newsgroup (except in X-posts). Being a native German speaker I am mostly active in the German ..NET (VB.NET, C#, .NET, VS) and VB6 groups. Maybe you are mixing me up with someone else?
wrote quite plainly if you run into VB6 stuff which is available in VB.Net
you tend to choose the VB-compatible option.
If this is the opposite to "using the .NET Framework only and trying to avoid using the VB Runtime Library", then that's true.
It seems that you negatively connotate the term "low-level", which is not what I do.
Calling functions in function library has never been considered low-level to anyone I've known in the computer industry.
That's not what I consider low-level too. However, the link you posted
http://en.wikipedia.org/wiki/Low-level_programming_language.
is about programming languages. I am talking about libraries and I conform with the definition given in <URL:http://en.wikipedia.org/wiki/Low-level>. A "wrapper" /can/ be more high-level than the functionality it wraps, but this is /not necessarily/ the case.
Rather than my applying a negative connotation doesn't it appear more likely that you misused the term "low-level" to make people think it was harder to use the .Net Framework?
No, I didn't. I just wanted to say that parts of the .NET Framework provide full functionality, but in reality a simplified form is commonly requested and thus a wrapper can be more "high-level".
You understand the difference between buying (for instance) a Sony TV which develops a problem and proclaiming "Sony TVs suck" and the statement "I bought a Sony once and it had a problem."
Does that really matter here? If there are problems associated with the function, regardless of their actual reason, why would I want to prefer it over another method that doesn't suffer from the problem and has been used for years?
It only matters when you insist that your misapplication of the screwdriver analogy along with your misuse of the term low-level combined with your insistence that there are fewer letters to type in the function name Len() matters. You can write "I hit that bug" if you in fact hit that bug and everybody would consider that a heads-up warning. Alternatively you can scour your friend's blogs for rarely encountered bugs to support your position. One is real, one is artificial.
Take a look at my reply to Göran showing a typical scenario in which the problem occurs ( <URL:news:ODk0Gm3YHHA.2316@xxxxxxxxxxxxxxxxxxxx>).
I am currently working in another domain, not using .NET at all, but I would not have a problem to do my work in C# if this was decided for a project.
In that case what would you do if you needed need to test if a string was IsNullOrEmpty? There is a bug in the JIT optimizer you know?
I'd use something not affected by the bug. My tests showed that it does not occur when using 'Len' instead of 'IsNullOrEmpty' and that Len' provides a semantically similar replacement. In C# I'd continue to write 'if (s == null || s.Length == 0)'.
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
.
- Follow-Ups:
- Re: Checking for A Blank String
- From: Tom Leylan
- Re: Checking for A Blank String
- References:
- Re: Checking for A Blank String
- From: Herfried K. Wagner [MVP]
- Re: Checking for A Blank String
- From: \(O\)enone
- Re: Checking for A Blank String
- From: Göran Andersson
- Re: Checking for A Blank String
- From: Herfried K. Wagner [MVP]
- Re: Checking for A Blank String
- From: Göran Andersson
- Re: Checking for A Blank String
- From: \(O\)enone
- Re: Checking for A Blank String
- From: Göran Andersson
- Re: Checking for A Blank String
- From: Herfried K. Wagner [MVP]
- Re: Checking for A Blank String
- From: Tom Leylan
- Re: Checking for A Blank String
- From: Herfried K. Wagner [MVP]
- Re: Checking for A Blank String
- From: Tom Leylan
- Re: Checking for A Blank String
- From: Herfried K. Wagner [MVP]
- Re: Checking for A Blank String
- From: Tom Leylan
- Re: Checking for A Blank String
- From: Herfried K. Wagner [MVP]
- Re: Checking for A Blank String
- From: Tom Leylan
- Re: Checking for A Blank String
- Prev by Date: Re: Checking for A Blank String
- Next by Date: Re: Checking for A Blank String
- Previous by thread: Re: Checking for A Blank String
- Next by thread: Re: Checking for A Blank String
- Index(es):
Relevant Pages
|