Re: Ignoring excpetions in catch

2010-06-02 Thread mike smith
-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

RE: Ignoring excpetions in catch

2010-06-01 Thread James Chapman-Smith
- 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

RE: Ignoring excpetions in catch

2010-06-01 Thread Trevor Andrew
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

Re: Ignoring excpetions in catch

2010-06-01 Thread mike smith
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

Ignoring excpetions in catch

2010-05-31 Thread Arjang Assadi
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

Re: Ignoring excpetions in catch

2010-05-31 Thread Eddie de Bear
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

Re: Ignoring excpetions in catch

2010-05-31 Thread Grant Maw
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

RE: Ignoring excpetions in catch

2010-05-31 Thread Bill McCarthy
: 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

Re: Ignoring excpetions in catch

2010-05-31 Thread Arjang Assadi
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

Re: Ignoring excpetions in catch

2010-05-31 Thread Arjang Assadi
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

RE: Ignoring excpetions in catch

2010-05-31 Thread Greg Keogh
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