-boun...@ozdotnet.com [mailto:ozdotnet-boun...@ozdotnet.com] On
Behalf Of mike smith
Sent: Wednesday, 2 June 2010 1:14 PM
To: ozDotNet
Subject: Re: Ignoring excpetions in catch
On 1 June 2010 18:37, James Chapman-Smith ja...@enigmativity.com wrote:
Handling exceptions requires exceptional
- he sums it up nicely I think.
:-)
James.
-Original Message-
From: ozdotnet-boun...@ozdotnet.com [mailto:ozdotnet-boun...@ozdotnet.com]
On Behalf Of Arjang Assadi
Sent: Tuesday, 1 June 2010 10:09
To: ozDotNet
Subject: Ignoring excpetions in catch
I thought only the beginner programmers
2010 10:50 AM
To: ozDotNet
Subject: Re: Ignoring excpetions in catch
LOL, when I tried that link, I got an exception(404) AND IT WASN'T
HANDLED, ROFL.
I guess that's your point!
Regards,
Matt
--
Debugging is twice as hard
it now.
:-)
James.
-Original Message-
From: ozdotnet-boun...@ozdotnet.com [mailto:ozdotnet-boun...@ozdotnet.com]
On Behalf Of Arjang Assadi
Sent: Tuesday, 1 June 2010 10:09
To: ozDotNet
Subject: Ignoring excpetions in catch
I thought only the beginner programmers or programmers
I thought only the beginner programmers or programmers without any
pride in their work or self discipline would write code like this:
try
{
//some code goes here
}
catch
{
//No code here just business as usual, do nothing about the exceptions!
}
but maybe I am wrong, this
Yep, just change the cast from:
ctlMDI = (MdiClient) ctl;
to
ctlMDI = ctl as MdiClient;
then check for null.
But having said that, I'm sure all of the code on MSDN/Microsoft web sites
are not production ready.. The code is only to communicate ideas..
Just my 2c...
Ed.
On Tue, Jun 1, 2010 at
Your example is a catch all which is bad practice.
The example in the MS article catches a specific exception. This is not the
same thing. There can be circumstances where you want to catch a specific
exception and do nothing about it.
On 1 June 2010 10:38, Arjang Assadi arjang.ass...@gmail.com
: Ignoring excpetions in catch
|
|I thought only the beginner programmers or programmers without any
|pride in their work or self discipline would write code like this:
|
|try
|{
| //some code goes here
|}
|catch
|{
| //No code here just business as usual, do nothing about the exceptions
Agreed, e.g. using 3rd party controls where one is at the mercy of
what ever is given is the only circumstance that comes to my mind. is
there any other circumstance that one would want to do nothing about
the exception and fix the cause rather than ignore the symptom?
Kind Regards
Arjang
On 1
Hi Bill,
Thank you for your reply. I knew that, but the question is the
practice of ignoring excpetions in catch.
Using is and as is 1% improvement over a ignoring the
exception in that example by any means, that was also suggested by
Eddie. But why or when would one ignore the specific
I wouldn't take that sample code seriously, I guess it's old. As the others
said, in that case a cast as or try would be more appropriate. The Framework
Design Guidelines http://msdn.microsoft.com/en-us/library/ms229042.aspx
(BOOK
11 matches
Mail list logo