Click here to Skip to main content
15,913,685 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: What is meant by Defensive Programming? Pin
Maximilien3-Nov-15 1:07
Maximilien3-Nov-15 1:07 
GeneralRe: What is meant by Defensive Programming? Pin
Richard Deeming3-Nov-15 2:26
mveRichard Deeming3-Nov-15 2:26 
GeneralRe: What is meant by Defensive Programming? Pin
Maximilien3-Nov-15 2:47
Maximilien3-Nov-15 2:47 
GeneralRe: What is meant by Defensive Programming? Pin
kdmote4-Nov-15 5:05
kdmote4-Nov-15 5:05 
AnswerRe: What is meant by Defensive Programming? Pin
Super Lloyd3-Nov-15 1:21
Super Lloyd3-Nov-15 1:21 
GeneralRe: What is meant by Defensive Programming? Pin
Wynter Dragon4-Nov-15 4:16
Wynter Dragon4-Nov-15 4:16 
GeneralRe: What is meant by Defensive Programming? Pin
harold aptroot3-Nov-15 2:15
harold aptroot3-Nov-15 2:15 
GeneralRe: What is meant by Defensive Programming? PinPopular
W Balboos, GHB3-Nov-15 2:16
W Balboos, GHB3-Nov-15 2:16 
A more generic answer:

Presume the user's brain is elephanted, or their out to get you. Really.

They do the most absurd things that no rational sentient being would ever consider - and if you ask them why, they often have no reason - but they'll find a way to break your code.

Or rather, assume the preceding paragraph is gospel - the user is the enemy - so defend yourself against an imminent attack.

Much of this, despite the rigorous coding practices suggested by others, comes from hard-won experience and much shaking of the head (and foul oaths).

Another important thing to remember is that you really can't test/debug your own code. You make it as perfect as you can, but someone who doesn't know what's under the hood should push the buttons.




"The difference between genius and stupidity is that genius has its limits." - Albert Einstein
"As far as we know, our computer has never had an undetected error." - Weisert
"If you are searching for perfection in others, then you seek disappointment. If you are seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010

GeneralRe: What is meant by Defensive Programming? Pin
Marc Clifton3-Nov-15 2:22
mvaMarc Clifton3-Nov-15 2:22 
GeneralRe: What is meant by Defensive Programming? Pin
OriginalGriff3-Nov-15 2:29
mveOriginalGriff3-Nov-15 2:29 
GeneralRe: What is meant by Defensive Programming? Pin
Munchies_Matt3-Nov-15 2:39
Munchies_Matt3-Nov-15 2:39 
GeneralRe: What is meant by Defensive Programming? Pin
Eytukan3-Nov-15 3:24
Eytukan3-Nov-15 3:24 
GeneralRe: What is meant by Defensive Programming? Pin
BillWoodruff3-Nov-15 5:01
professionalBillWoodruff3-Nov-15 5:01 
GeneralRe: What is meant by Defensive Programming? Pin
PIEBALDconsult3-Nov-15 12:46
mvePIEBALDconsult3-Nov-15 12:46 
GeneralRe: What is meant by Defensive Programming? Pin
zandam3-Nov-15 22:35
zandam3-Nov-15 22:35 
GeneralRe: What is meant by Defensive Programming? Pin
Mycroft Holmes3-Nov-15 13:52
professionalMycroft Holmes3-Nov-15 13:52 
GeneralRe: What is meant by Defensive Programming? Pin
R. Erasmus3-Nov-15 23:29
R. Erasmus3-Nov-15 23:29 
GeneralRe: What is meant by Defensive Programming? Pin
Kirk 103898214-Nov-15 3:05
Kirk 103898214-Nov-15 3:05 
GeneralRe: What is meant by Defensive Programming? Pin
Ferd Really4-Nov-15 4:55
Ferd Really4-Nov-15 4:55 
GeneralRe: What is meant by Defensive Programming? Pin
Kirk 103898214-Nov-15 5:05
Kirk 103898214-Nov-15 5:05 
GeneralRe: What is meant by Defensive Programming? Pin
Sucramsy4-Nov-15 8:44
Sucramsy4-Nov-15 8:44 
GeneralFOSW OTD 03. November 2015 1. Hint Pin
HobbyProggy2-Nov-15 23:46
professionalHobbyProggy2-Nov-15 23:46 
GeneralRe: FOSW OTD 03. November 2015 Pin
Kornfeld Eliyahu Peter2-Nov-15 23:51
professionalKornfeld Eliyahu Peter2-Nov-15 23:51 
GeneralRe: FOSW OTD 03. November 2015 Pin
HobbyProggy2-Nov-15 23:55
professionalHobbyProggy2-Nov-15 23:55 
GeneralRe: FOSW OTD 03. November 2015 Pin
Kornfeld Eliyahu Peter3-Nov-15 0:00
professionalKornfeld Eliyahu Peter3-Nov-15 0:00 

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.