Click here to Skip to main content
15,353,676 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)

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: 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 
GeneralIsn't that an anti-pattern...? Pin
Sander Rossel13-May-12 19:36
professionalSander Rossel13-May-12 19:36 
Let's say I build a function that takes an Object as parameter and the Object is Nothing/null... Don't you want/need to throw a ReferenceNullException? Not doing so and pretending everything went well seems like a code smell to me (and I've worked with code that does exactly that). If the programmer fails to Catch the Exception that's his problem, not mine. If the state of my Class/Library becomes inconsistent as a result of an Exception then that's my problem, but even more the programmer's who uses it Poke tongue | ;-P
Maybe I'm misunderstanding the concept and I should take judo lessons...
It's an OO world.
public class Naerling : Lazy<Person>{
    public void DoWork(){ throw new NotImplementedException(); }

GeneralRe: Isn't that an anti-pattern...? Pin
Reiss13-May-12 20:54
professionalReiss13-May-12 20:54 
GeneralRe: Isn't that an anti-pattern...? Pin
PIEBALDconsult14-May-12 3:21
professionalPIEBALDconsult14-May-12 3:21 
GeneralRe: Isn't that an anti-pattern...? Pin
Sander Rossel14-May-12 7:37
professionalSander Rossel14-May-12 7:37 
GeneralRe: Isn't that an anti-pattern...? Pin
Ravi Bhavnani14-May-12 6:02
professionalRavi Bhavnani14-May-12 6: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.