Click here to Skip to main content
15,358,470 members

Survey Results

Do you do defensive programming?

Survey period: 14 May 2012 to 21 May 2012

"Defensive programming is ... intended to ensure the continuing function of a piece of software in spite of unforeseeable usage of said software". ie provide air-bags and ABS for your code. (suggested by the enigmatic V)

OptionVotes% 
Yes, I use defensive programming always19316.67
I use defensive programming mostly51044.04
I use defensive programming rarely19817.10
No, I don't use defensive programming design595.09
I have no idea of what you speak.19817.10



 
GeneralRe: we do offensive programming (sounds better!) Pin
RedSonja14-May-12 21:52
MemberRedSonja14-May-12 21:52 
GeneralBuilt-in vs Ad hoc Pin
Peter N Roth14-May-12 14:12
MemberPeter N Roth14-May-12 14:12 
GeneralRe: Built-in vs Ad hoc Pin
Rob Grainger14-May-12 23:41
MemberRob Grainger14-May-12 23:41 
GeneralRe: Built-in vs Ad hoc Pin
Peter N Roth15-May-12 6:29
MemberPeter N Roth15-May-12 6:29 
GeneralMessage Removed Pin
15-May-12 8:02
professionalN_tro_P15-May-12 8:02 
Generalfensive Pin
TinyRamsamy14-May-12 12:13
MemberTinyRamsamy14-May-12 12:13 
GeneralDefensive Mostly Pin
JackDingler14-May-12 7:32
MemberJackDingler14-May-12 7:32 
GeneralDefensive vs. Protected Pin
SASS_Shooter14-May-12 7:13
MemberSASS_Shooter14-May-12 7:13 
Kinda surprised at the people that say they don't know how the code will be used or writing secure code.

I see defensive coding as following a set pattern of tests before accessing an object:
Is it null when it shouldn't be?
Is it of the proper format expected?
Am I trapping possible exceptions?
Am I logging those exceptions and returning a message?

Basically defensive programming is making sure that in spite of usage that nothing will cause the unexpected exception window to pop up and stop the application from running.
GeneralI have no idea of what you speak Pin
CPallini14-May-12 6:39
mveCPallini14-May-12 6:39 
GeneralDefensive = secure Pin
ed welch14-May-12 6:22
Membered welch14-May-12 6:22 
GeneralDefensive, but not too defensive Pin
Nemanja Trifunovic14-May-12 4:43
MemberNemanja Trifunovic14-May-12 4:43 
GeneralNever developed a software with granted foreseeable usage... Pin
AlexCode14-May-12 2:50
professionalAlexCode14-May-12 2:50 
GeneralRe: Never developed a software with granted foreseeable usage... Pin
RedSonja14-May-12 20:51
MemberRedSonja14-May-12 20:51 
GeneralRe: Never developed a software with granted foreseeable usage... Pin
AlexCode14-May-12 21:15
professionalAlexCode14-May-12 21:15 
GeneralRe: Never developed a software with granted foreseeable usage... Pin
RedSonja14-May-12 21:51
MemberRedSonja14-May-12 21:51 
GeneralRe: Never developed a software with granted foreseeable usage... Pin
AlexCode14-May-12 21:58
professionalAlexCode14-May-12 21:58 
GeneralSaid yes to defensive programming but... Pin
PedroMC14-May-12 1:28
MemberPedroMC14-May-12 1:28 
GeneralNo choice Pin
RedSonja14-May-12 0:32
MemberRedSonja14-May-12 0:32 
GeneralRe: No choice Pin
MichP14-May-12 8:36
MemberMichP14-May-12 8:36 
GeneralRe: No choice Pin
RedSonja14-May-12 20:36
MemberRedSonja14-May-12 20:36 
GeneralWhen given the time Pin
chriselst13-May-12 23:53
Memberchriselst13-May-12 23:53 
GeneralRe: When given the time Pin
Slacker00714-May-12 0:14
professionalSlacker00714-May-12 0:14 
GeneralRe: When given the time Pin
PedroMC14-May-12 1:36
MemberPedroMC14-May-12 1:36 
GeneralRe: When given the time Pin
chriselst14-May-12 1:40
Memberchriselst14-May-12 1:40 
GeneralRe: When given the time Pin
PedroMC14-May-12 1:49
MemberPedroMC14-May-12 1:49 

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.