Linked Questions

49 votes
10 answers
17k views

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 ...
Richard Keller's user avatar
30 votes
9 answers
52k views

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 ...
Thaven's user avatar
  • 659
8 votes
3 answers
491 views

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 ...
cory ginsberg's user avatar
-3 votes
2 answers
1k views

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, ...
Uri Abramson's user avatar
56 votes
8 answers
22k views

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 ...
orome's user avatar
  • 713
29 votes
7 answers
12k views

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 ...
Praxeolitic's user avatar
  • 1,674
13 votes
2 answers
3k views

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 ...
Zairja's user avatar
  • 241
1 vote
5 answers
1k views

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 ...
Lefteris008's user avatar
3 votes
4 answers
626 views

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 ...
Adam's user avatar
  • 295
0 votes
2 answers
1k views

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 ...
bigcodeszzer's user avatar
1 vote
1 answer
546 views

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 ...
user58446's user avatar
  • 327
0 votes
1 answer
114 views

Which is preferable for both solid technique and secure coding? Example #1: function_one() blah; function_two() blah; print blah; exit; ... Example #2: ...
user58446's user avatar
  • 327
0 votes
1 answer
222 views

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 ...
serv-inc's user avatar
  • 225
0 votes
2 answers
151 views

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 ...
TreK's user avatar
  • 257