Click here to Skip to main content
15,887,485 members

Survey Results

Which of the following issues are best handled using Exceptions?

Survey period: 9 Feb 2015 to 16 Feb 2015

Exception handling provides a way to deal with any unexpected or exceptional situations. Define "unexpected".

OptionVotes% 
My bad code (null reference, divide by zero, index out of range etc)53645.85
Errors due to failed network connection70260.05
External Resource (eg webservice) not found or available66556.89
Backend server fails (eg internal database or cache server goes down)70560.31
Local resource access fails (eg can't open a file)63254.06
Timeout (database, file access, network connection)65556.03
Invalid parameter values36731.39
Invalid data supplied by the user30225.83
Respondents were allowed to choose more than one answer; totals may not add up to 100%



 
GeneralRe: Invalid User Supplied By Human Resources Pin
Bruno Tabbia9-Feb-15 8:49
Bruno Tabbia9-Feb-15 8:49 
GeneralRe: Invalid User Supplied By Human Resources Pin
Nelek10-Feb-15 10:04
protectorNelek10-Feb-15 10:04 
GeneralInvalid Parameter values Pin
Dennis E White9-Feb-15 4:53
professionalDennis E White9-Feb-15 4:53 
GeneralRe: Invalid Parameter values Pin
Maciej Los9-Feb-15 6:13
mveMaciej Los9-Feb-15 6:13 
GeneralRe: Invalid Parameter values Pin
Dennis_E10-Feb-15 21:29
professionalDennis_E10-Feb-15 21:29 
GeneralRe: Invalid Parameter values Pin
H.Brydon10-Feb-15 12:47
professionalH.Brydon10-Feb-15 12:47 
Generalhow if feel about this Pin
Slacker0079-Feb-15 4:41
professionalSlacker0079-Feb-15 4:41 
GeneralI personally love try...catch but.. PinPopular
Afzaal Ahmad Zeeshan9-Feb-15 3:40
professionalAfzaal Ahmad Zeeshan9-Feb-15 3:40 
I would never try to create a software application where the application starts with a try catch block and ends with a try catch block having multiple other try catch blocks. Where is the software in there? Every idiot can write a software, if the softwares were able to handle themself correctly. The need of a programmer is to understand and then write application, not to simply just apply a try catch and let the OS or the machine itself deal with the problem, it is just like:

- Son: Dad, there is a lizard in my room!
- Dad: Son, try catching it. It will resolve the problem.

I myself do not like to use a try catch block, where ever possible. Since there was an option of Files, I personally use

C#
if(File.Exists("<location>")){
  // File exists
}


instead of

C#
try {
   // code here
} catch (Exception) {
   // Maybe the file was not found
}


The first code seems better and more understandable, instead of the second one, which makes very less or atleast takes C# 6 to allow conditions in catch statements. So wrapping those statements whose data (or result) you know like existence of file, data type of data, you should always use an if...else statement.

However, it would be a good approach to wrap such statements, which involve unexpected errors, such as network failure, there you need to use try catch statements, because error might be raised or it might not be.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~

GeneralRe: I personally love try...catch but.. Pin
Uwe Keim9-Feb-15 4:29
sitebuilderUwe Keim9-Feb-15 4:29 
GeneralRe: I personally love try...catch but.. Pin
Afzaal Ahmad Zeeshan9-Feb-15 5:09
professionalAfzaal Ahmad Zeeshan9-Feb-15 5:09 
GeneralRe: I personally love try...catch but.. Pin
PIEBALDconsult12-Feb-15 10:08
mvePIEBALDconsult12-Feb-15 10:08 
AnswerRe: I personally love try...catch but.. Pin
Afzaal Ahmad Zeeshan13-Feb-15 0:00
professionalAfzaal Ahmad Zeeshan13-Feb-15 0:00 
GeneralRe: I personally love try...catch but.. Pin
PIEBALDconsult13-Feb-15 2:00
mvePIEBALDconsult13-Feb-15 2:00 
GeneralRe: I personally love try...catch but.. Pin
Afzaal Ahmad Zeeshan13-Feb-15 2:37
professionalAfzaal Ahmad Zeeshan13-Feb-15 2:37 
GeneralMissing alternative. PinPopular
Jonas Hammarberg9-Feb-15 2:53
professionalJonas Hammarberg9-Feb-15 2:53 
GeneralRe: Missing alternative. Pin
Maciej Los9-Feb-15 6:16
mveMaciej Los9-Feb-15 6:16 
GeneralRe: Missing alternative. Pin
Cristian Amarie9-Feb-15 23:43
Cristian Amarie9-Feb-15 23:43 
GeneralThere are no exceptions Pin
Mike Hankey9-Feb-15 1:31
mveMike Hankey9-Feb-15 1:31 
GeneralRe: There are no exceptions Pin
CDP18029-Feb-15 1:54
CDP18029-Feb-15 1:54 
GeneralRe: There are no exceptions Pin
Mike Hankey9-Feb-15 1:58
mveMike Hankey9-Feb-15 1:58 
GeneralRe: There are no exceptions Pin
CDP18029-Feb-15 3:41
CDP18029-Feb-15 3:41 
GeneralRe: There are no exceptions Pin
Mike Hankey9-Feb-15 3:55
mveMike Hankey9-Feb-15 3:55 
GeneralRe: There are no exceptions Pin
Ștefan-Mihai MOGA9-Feb-15 1:58
professionalȘtefan-Mihai MOGA9-Feb-15 1:58 
GeneralAll errors are unexpected PinPopular
CDP18029-Feb-15 0:30
CDP18029-Feb-15 0:30 
GeneralAll but user input, but not all the time PinPopular
Rob Grainger8-Feb-15 23:36
Rob Grainger8-Feb-15 23:36 

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.