Re: Is there a difference between passing "" and passing Nothing to a Windows API ?
- From: "m.posseth" <posseth@xxxxxxxxx>
- Date: Tue, 14 Feb 2006 09:01:16 +0100
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.
.
- References:
- Is there a difference between passing "" and passing Nothing to a Windows API ?
- From: academic
- Re: Is there a difference between passing "" and passing Nothing to a Windows API ?
- From: m.posseth
- Re: Is there a difference between passing "" and passing Nothing to a Windows API ?
- From: Mattias Sjögren
- Re: Is there a difference between passing "" and passing Nothing to a Windows API ?
- From: m.posseth
- Re: Is there a difference between passing "" and passing Nothing to a Windows API ?
- From: Mattias Sjögren
- Is there a difference between passing "" and passing Nothing to a Windows API ?
- Prev by Date: Re: is there a way to do this
- Next by Date: Re: How to split a form when coding?
- Previous by thread: Re: Is there a difference between passing "" and passing Nothing to a Windows API ?
- Next by thread: Re: Is there a difference between passing "" and passing Nothing to a Windows API ?
- Index(es):
Relevant Pages
|