Linked Questions
14 questions linked to/from Check First vs Exception Handling?
49
votes
10
answers
17k
views
Why are exceptions considered better than explicit error testing? [duplicate]
Possible Duplicate:
Defensive Programming vs Exception Handling?
if/else statements or exceptions
I often come across heated blog posts where the author uses the argument: "exceptions vs ...
30
votes
9
answers
52k
views
if/else statements or exceptions [duplicate]
I don't know whether this question fits better on this site or on Stack Overflow, but because my question is connected rather to practices, that some specified problem.
So, consider an object that ...
8
votes
3
answers
491
views
Would it be better to have extra checks, or would it be a waste of time? [duplicate]
In your opinion, do you think it is a waste of time to make checks that you know there is no possible way of it being there/not being there, or would you just put it there just in case there is a bug ...
-3
votes
2
answers
1k
views
Why ever use exception throw (in C#) except for Class Library development? [duplicate]
Why would I ever throw exceptions in code? (except for one specific scenario where I am developing a class library which the consumers of it, will not want / be able to change).
To be more specific, ...
56
votes
8
answers
22k
views
Why design a modern language without an exception-handling mechanism?
Many modern languages provide rich exception handling features, but Apple's Swift programming language does not provide an exception handling mechanism.
Steeped in exceptions as I am, I'm having ...
29
votes
7
answers
12k
views
Should a C++ program catch all exceptions and prevent exceptions from bubbling up past main()?
I was once advised that a C++ program should ultimately catch all exceptions. The reasoning given at the time was essentially that programs which allow exceptions to bubble up outside of main() enter ...
13
votes
2
answers
3k
views
How should I handle logger failures?
In several of our company's applications, we use a custom logger. It's fairly robust, though we may replace it with something like NLog in the future. One of the logger's tasks is to log any ...
1
vote
5
answers
1k
views
Limits of Defensive Programming acknowledging that Exception Handling should be avoided
I've read Defensive Programming vs Exception Handling? and if/else statements or exceptions, but none contain something relevant to what I'm searching for.
Taking into account that exception handling ...
3
votes
4
answers
626
views
Is it possible/good idea to reduce chance of crashing by catching Error?
I have a class the implements A which will run a certain method of class B. There is a requirement that this A should never crash when running this operation (which is not possible, right?).
To ...
0
votes
2
answers
1k
views
Exception Handling: When and Why?
The main languages I use are C++ and Java.
Both languages support exception handling.
I confess, I may not actually understand exception handling, at least, I certainly don't understand why you ...
1
vote
1
answer
546
views
Is a General Exception In Addition To Expected Exceptions Defensive or Unecessary?
I have read this and this and this: if my question misses the point in those answers, please point it out and we'll get this one deleted. These questions indicate that this may actually be a bad thing ...
0
votes
1
answer
114
views
Sending Out Functions To Return Or To Die
Which is preferable for both solid technique and secure coding?
Example #1:
function_one()
blah;
function_two()
blah;
print blah;
exit;
...
Example #2:
...
0
votes
1
answer
222
views
The Same Behavior for Boolean and Exception
The following code uses a boolean preference active: In the active state, it does an operation which could throw an exception. On this exception, it does fall back to the non-active state.
let active ...
0
votes
2
answers
151
views
Should methods perform checks that they accomplished the task they were built for? or should they just throw an exception?
What are some pro's and con's of validating your performed the task intended?
public static bool UploadFile(string filename)
{
// 1. upload the file
// 2. check to see if the file now exist ...