Re: Is there a difference between passing "" and passing Nothing to a Windows API ?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



so by Francesco Balena and Giusseppe Dimauro and MS Press it is :-)

Then I guess I'll have to disagree with them, it wouldn't be the first
time.


Well ,,,,, i learned a lot from Francesco and his assistents , to me he is
the ultimate Guru
also for the fact that when he recomends something he has a good explanation
why or why not to do it
however as i said before this book is about "practical guidelines and best
practices" if you feel you do not need them don`t use them


By the way the book is also stating that it addopted the internal guidelines
of MS


Do they also recommend catch-all exception handling (or On Error
Resume Next style programming)?


No they recomend the opposite ,,,, use it as few as possible ( it is better
to check for yourself if possible as relying on the exception object , and
they tell to stay away from on error syntax )

In this thread i am fully with Carlos , he reflects my opinion

maybe it is a mind twist that we share the same as i also started on the
C64 :-)


regards

Michel Posseth [MCP]






"Mattias Sjögren" <mattias.dont.want.spam@xxxxxxxx> schreef in bericht
news:e$nVucOMGHA.2992@xxxxxxxxxxxxxxxxxxxxxxx
According to "practical guidelines and best practices for Microsoft
Visual
Basic and Visual C# Developers"

so by Francesco Balena and Giusseppe Dimauro and MS Press it is :-)

Then I guess I'll have to disagree with them, it wouldn't be the first
time.


Explicit assignment avoids NullReferenceException errors when referencing
the string and simplifies code ( because the string doesn`t have to be
tested against null )

I won't trade correctness for simplicity. Assigning "" to strings by
default, just to avoid NullReferenceExceptions, feels like a hack that
will just hide the actual problem. Exceptions can be good things if
they help you find errors during development, suppressing them is
taking the easy way out.

Do they also recommend catch-all exception handling (or On Error
Resume Next style programming)?


Mattias

--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.


.



Relevant Pages

  • Re: resolving parameters in a query
    ... I disagree with YOUR solution of using a variant. ... and then test for a zero-length string. ... Dim qdf As DAO.QueryDef ... Set rst = qdf.OpenRecordset ...
    (microsoft.public.access.formscoding)
  • Re: Alan Turings Halting Problem is incorrectly formed
    ... show me which step you disagree with: ... "p" specifies, and thus 'P' could specify something such as find ... > a string as an argument, and p is the string that is the ... > definition of P, then by definition of NSH, ...
    (sci.logic)
  • Re: check for empty Strings
    ... feel free disagree whenever you see a valid reason to! ... Returns false if lastName is null or a different string to "" ... > the reference is not null. ...
    (comp.lang.java.help)
  • Re: I need some basic C++ help
    ... I think there are better examples for arrays. ... Partially disagree - a "beginner" is rarely going to be doing code ... > then switch to standard string class. ... use a screwdriver to pound in a hammer, so that first hammer purchase will ...
    (comp.lang.cpp)
  • Re: tasks and protected types
    ... > Fabio de Francesco wrote: ... > Global objects are a _very_ bad idea when doing tasking. ... > Here you make the lenght of the string Msg 0. ... It will fail with a Constraint_Error, but with tasking you don't ...
    (comp.lang.ada)