Click here to Skip to main content
15,350,990 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: When given the time Pin
PedroMC14-May-12 1:49
MemberPedroMC14-May-12 1:49 
GeneralRe: When given the time Pin
chriselst14-May-12 1:54
Memberchriselst14-May-12 1:54 
GeneralRe: When given the time Pin
Fabio Franco14-May-12 10:15
professionalFabio Franco14-May-12 10:15 
GeneralWe have many defensive programmers. Pin
mojp13-May-12 23:16
Membermojp13-May-12 23:16 
GeneralRe: We have many defensive programmers. Pin
jim lahey13-May-12 23:50
Memberjim lahey13-May-12 23:50 
GeneralYes, I do Pin
Prasad_Kulkarni13-May-12 22:42
MemberPrasad_Kulkarni13-May-12 22:42 
GeneralRe: Yes, I do Pin
AlexCode14-May-12 21:26
professionalAlexCode14-May-12 21:26 
Generalone of the principals of testing Pin
R. Erasmus13-May-12 22:36
MemberR. Erasmus13-May-12 22:36 
One of the principals of testing is to ensure whether a function is robust.
A function is made robust through means of defensive programming.

To the people that doesn't understand what defensive programming is:
An simple example:

C++
bool increment_by_one(unsigned int32* input1)
{
  bool status = FALSE;

  /* defensive programming - Ensure's that 'NULL pointer exception' or 'memory violation'
     doesn't occur */
  if (input1 != NULL)
  {
    *input++;
    status = TRUE;
  }
  else
  {
    status = FALSE;
  }

  return status;
}

"Program testing can be used to show the presence of bugs, but never to show their absence."

<< please vote!! >>


modified 14-May-12 5:02am.

GeneralWTF defensive programming Pin
Ra-one13-May-12 21:31
MemberRa-one13-May-12 21:31 
GeneralRe: WTF defensive programming Pin
OriginalGriff13-May-12 21:52
mveOriginalGriff13-May-12 21:52 
GeneralRe: WTF defensive programming Pin
chriselst13-May-12 23:48
Memberchriselst13-May-12 23:48 
GeneralRe: WTF defensive programming Pin
JOAT-MON14-May-12 7:08
MemberJOAT-MON14-May-12 7:08 
GeneralRe: WTF defensive programming Pin
JackDingler14-May-12 7:20
MemberJackDingler14-May-12 7:20 
GeneralRe: WTF defensive programming Pin
Fabio Franco14-May-12 10:19
professionalFabio Franco14-May-12 10:19 
GeneralRe: WTF defensive programming Pin
Ra-one14-May-12 21:30
MemberRa-one14-May-12 21:30 
GeneralRe: WTF defensive programming Pin
JackDingler14-May-12 7:19
MemberJackDingler14-May-12 7:19 
GeneralFirst Pin
ycg16691113-May-12 21:26
Memberycg16691113-May-12 21:26 
GeneralRe: First Pin
OriginalGriff13-May-12 21:52
mveOriginalGriff13-May-12 21:52 
GeneralRe: First Pin
Old Nic13-May-12 23:36
MemberOld Nic13-May-12 23:36 
GeneralRe: First Pin
ycg16691114-May-12 0:22
Memberycg16691114-May-12 0:22 
GeneralWell Pin
Prasad_Kulkarni13-May-12 20:31
MemberPrasad_Kulkarni13-May-12 20:31 
GeneralRe: Well Pin
codeBegin13-May-12 20:32
MembercodeBegin13-May-12 20:32 
GeneralRe: Well Pin
OriginalGriff13-May-12 21:53
mveOriginalGriff13-May-12 21:53 
GeneralRe: Well Pin
Prasad_Kulkarni13-May-12 22:33
MemberPrasad_Kulkarni13-May-12 22:33 
GeneralRe: Well Pin
codeBegin13-May-12 23:02
MembercodeBegin13-May-12 23:02 

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.