Re: Checking for A Blank String

Tech-Archive recommends: Fix windows errors by optimizing your registry



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/>

.



Relevant Pages

  • Re: to learn jQuery if already using prototype
    ... You stated that these libraries were junk as though it ... we welcome bug reports. ... understanding of javascript or browser scripting who just happens to be ... I can't guarantee that any of us will write bug-free code on the first ...
    (comp.lang.javascript)
  • Re: ZLib double free bug: Windows NT potentially unaffected
    ... I've been researching this bug since I heard that ssh passes packets to zlib ... Double free vulnerabilities are primarily an issue for malloc implementations ... how exploitation of this error works entitled: ... Also as noted above some malloc libraries have explicit protection mechanisms ...
    (Bugtraq)
  • Re: Errors: R6025 and Friends
    ... party libraries became extremely finicky on how everything was initialized ... There's both _heapwalk() and _heapchkand they do slightly different things. ... So I decided that I will run this program in Debug mode on the test server ... I would suggest that even thinking that reformatting a hard drive could fix a program bug ...
    (microsoft.public.vc.mfc)
  • Re: pthreads/dlopen issue when building krb-1.6.3 on AIX 6.1?
    ... If you feel like submitting the report, that would save me the trouble of figuring out and signing up for an account on the bug tracking system. ... I'm still mucking with getting pthreads enabled properly, but I have a little bit more Googling to do before I can ask a proper question about that. ... I'm mostly in need of the client libraries and utilities. ...
    (comp.protocols.kerberos)
  • [Full-disclosure] [GOODFELLAS-VULN] FileFind class from MFC Library cause heap overflow
    ... The GOODFELLAS security research team has found a bug in the ... MFC42 and MFC71 libraries offered natively in Windows, specifically, ... The FindFile method allocates memory for the buffer. ...
    (Full-Disclosure)