Click here to Skip to main content
15,925,181 members
Home / Discussions / C#
   

C#

 
GeneralRe: problem with gacutil Pin
amalatsliit13-Sep-04 0:09
amalatsliit13-Sep-04 0:09 
GeneralRe: problem with gacutil Pin
sreejith ss nair13-Sep-04 0:13
sreejith ss nair13-Sep-04 0:13 
GeneralRe: problem with gacutil Pin
amalatsliit13-Sep-04 0:22
amalatsliit13-Sep-04 0:22 
GeneralRe: problem with gacutil Pin
sreejith ss nair13-Sep-04 0:40
sreejith ss nair13-Sep-04 0:40 
GeneralThreadStart Pin
sreejith ss nair12-Sep-04 20:14
sreejith ss nair12-Sep-04 20:14 
GeneralRe: ThreadStart Pin
leppie12-Sep-04 21:40
leppie12-Sep-04 21:40 
GeneralRe: ThreadStart Pin
sreejith ss nair12-Sep-04 22:28
sreejith ss nair12-Sep-04 22:28 
GeneralRe: ThreadStart Pin
Dave Kreskowiak13-Sep-04 5:58
mveDave Kreskowiak13-Sep-04 5:58 
GeneralRe: ThreadStart Pin
sreejith ss nair13-Sep-04 18:22
sreejith ss nair13-Sep-04 18:22 
QuestionWhat´s the best way for validating input data? Pin
markdbd12-Sep-04 20:05
markdbd12-Sep-04 20:05 
AnswerRe: What´s the best way for validating input data? Pin
sreejith ss nair12-Sep-04 20:21
sreejith ss nair12-Sep-04 20:21 
GeneralRe: What´s the best way for validating input data? Pin
markdbd13-Sep-04 19:52
markdbd13-Sep-04 19:52 
General.NET, Reflection and private members Pin
J. Diamond12-Sep-04 17:43
J. Diamond12-Sep-04 17:43 
GeneralRe: .NET, Reflection and private members Pin
Alex Korchemniy12-Sep-04 20:38
Alex Korchemniy12-Sep-04 20:38 
GeneralRe: .NET, Reflection and private members Pin
J. Diamond13-Sep-04 6:49
J. Diamond13-Sep-04 6:49 
GeneralRe: .NET, Reflection and private members Pin
Alex Korchemniy13-Sep-04 6:55
Alex Korchemniy13-Sep-04 6:55 
GeneralRe: .NET, Reflection and private members Pin
J. Diamond13-Sep-04 7:11
J. Diamond13-Sep-04 7:11 
GeneralRe: .NET, Reflection and private members Pin
sreejith ss nair12-Sep-04 20:44
sreejith ss nair12-Sep-04 20:44 
QuestionWorking with BrowseFolderDialog flawed? Pin
LongRange.Shooter12-Sep-04 15:39
LongRange.Shooter12-Sep-04 15:39 
AnswerRe: Working with BrowseFolderDialog flawed? Pin
Stefan Troschuetz13-Sep-04 0:25
Stefan Troschuetz13-Sep-04 0:25 
Generali see why C# SHOULD have required to catch exceptions now Pin
vista2712-Sep-04 12:00
vista2712-Sep-04 12:00 
GeneralRe: i see why C# SHOULD have required to catch exceptions now Pin
Colin Angus Mackay12-Sep-04 13:52
Colin Angus Mackay12-Sep-04 13:52 
GeneralRe: i see why C# SHOULD have required to catch exceptions now Pin
Alex Korchemniy12-Sep-04 20:29
Alex Korchemniy12-Sep-04 20:29 
GeneralRe: i see why C# SHOULD have required to catch exceptions now Pin
Colin Angus Mackay12-Sep-04 22:20
Colin Angus Mackay12-Sep-04 22:20 
GeneralRe: i see why C# SHOULD have required to catch exceptions now Pin
User 12301612-Sep-04 22:38
User 12301612-Sep-04 22:38 
> what so hard about tracking down a general exception.

There are some general exceptions that can occur just about any time, for example. Think of an ExecutionEngineException, a StackOverflowException ThreadAbortException or OutOfMemoryException. It's almost impossible to handle some of these exceptions so that your application will run as expected afterwards (for some, even your finally-blocks will NOT be executed). But even if we're talking about not so "serious" exceptions: Often a single call to some method may result in one of five or more different exceptions. A general catch-block will handle all of these. But I think that often it's almost impossible to be sure such a catch-block can handle all of these exceptions properly. What you may get is unexpected behavior of your application. You may not even notice that something's wrong the time the error occurs, but maybe hundreds of lines of code later, and then these exceptions ARE hard to track down.

So I agree with Colin: using a general catch (Exception)-block may be a not so good idea. Instead, trying to catch specialized exceptions is the way to go. On the one hand, you can be sure what has to be done to get your application into a defined state. On the other hand, if any exception occurs you don't expect, you instantly will see that something's wrong (unhandled exception). Your way (setting a breakpoint) requires that you KNOW something went wrong. Handling general exception, this may not be the case, you may just get very unexpected behavior of your application afterwards, not knowing where the actual problem lies.

Just my 2 cents...

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.