3
votes
1answer
167 views

Java-Like 'throws'-information in method signature C#

From Java I know that the signatures of methods that can throw exceptions contain a throws block, that contains the Exception(s) that might be thrown. In C# there is no such thing and it is also not ...
0
votes
5answers
187 views

Fail-fast paradigm overheads

Fail-fast seems like a right way since it simplifies bug detection. But it's a harm for performance cause of multiple checking the same thing at several levels of the system. Simple example. There is ...
-1
votes
1answer
132 views

Making my code more robust [closed]

I have recently finished a piece of code that passed all tests. (Here is some idea what it does and Here is some actual code.) Problems began, however, when I run my code on the cloud with actual ...
1
vote
2answers
243 views

Wrapping specific checked exception in domain unchecked ones? [duplicate]

Uncle Bob says in Clean Code book that Unchecked Exceptions should be used. Now JDK has some checked exceptions: IOException, IllegalAccessException etc. which cannot be avoided. In my application ...
39
votes
10answers
3k 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 ...
8
votes
1answer
1k views

Best exception handling practices or recommendations? [closed]

I think the two main problems with my programs are my code structure/organization and my error handling. I'm reading Code Complete 2, but I need something to read for working with potential problems. ...
15
votes
6answers
4k views

Efficient try / catch block usage?

Should catch blocks be used for writing logic i.e. handle flow control etc? Or just for throwing exceptions? Does it effect efficiency or maintainability of code? What are the side effects (if there ...
12
votes
9answers
4k views

if/else statements or exceptions [duplicate]

Possible Duplicate: Defensive Programming vs Exception Handling? I don't know, that this question fit better on this site, or Stack Overflow, but because my question is connected rather to ...
8
votes
3answers
1k views

Exceptions or Error codes

We are building a web service(SOAP, .Net) which would be talking to (mostly) native clients (windows, C++) and we are wondering what is the best way to communicate errors to the client (e.g. ...
11
votes
5answers
665 views

When to start writing Exception Handling, Logging

When do you start writing your Exception Handling Code? When do you start writing Logging Statements. For the purpose of elaborating this question, let us assume that we are on .NET platform with ...
19
votes
12answers
2k views

How to teach Exception Handling for New Programmers?

How do you go about teaching Exception Handling to Programmers. All other things are taught easily - Data Structures, ASP.NET, WinForms, WPF, WCF - you name it, everything can be taught easily. With ...
7
votes
6answers
2k views

Do you handle Out-Of-Memory conditions?

What do you do when malloc returns 0 or new throws exception? Just halt or try to survive OOM condition/save the user's work?