Click here to Skip to main content
15,892,059 members

Survey Results

In which order do you test conditionals?   [Edit]

Survey period: 19 Jan 2009 to 26 Jan 2009

Behind every seemingly trival task there are vast schools of philosophy.

OptionVotes% 
Always if (statement is true) then... 42920.32
Always if (statement is false) then...572.70
It specifically depends on the situation1,42167.31
Random.482.27
I"ve never actually thought about it1567.39



 
GeneralRe: Check for Null Pin
WillemM19-Jan-09 6:23
WillemM19-Jan-09 6:23 
JokeRe: Check for Null Pin
hfrmobile19-Jan-09 22:26
hfrmobile19-Jan-09 22:26 
GeneralRe: Check for Null Pin
Dave Sexton19-Jan-09 6:41
Dave Sexton19-Jan-09 6:41 
GeneralDepends on the situation Pin
Vikram A Punathambekar19-Jan-09 5:28
Vikram A Punathambekar19-Jan-09 5:28 
Generaltry this Pin
JackMcG19-Jan-09 4:18
JackMcG19-Jan-09 4:18 
AnswerRe: try this Pin
ghle19-Jan-09 14:31
ghle19-Jan-09 14:31 
GeneralConditionals PinPopular
Ed Leighton-Dick19-Jan-09 4:06
Ed Leighton-Dick19-Jan-09 4:06 
GeneralRe: Conditionals Pin
Lee Humphries19-Jan-09 14:42
professionalLee Humphries19-Jan-09 14:42 
Pretty much agree with that thinking for CASE constructs of putting the most likely. Although I do break it fairly often too. For instance, I usually assume that someone else will get their hands dirty in my code sometime on the future, so I may use a more 'obvious' ordering to the conditions for the benefit of any poor sucker that comes behind.

However, when it comes to XSLT choose blocks I've often found it necessary to put the weird edge cases first and then proceed to the more commonly expected ones later. In other words filter out the strange stuff that requires special handling before you get to what you're really after. Unfortunately this is more CPU intensive, but then again that's XSLT. Smile | :)

I just love Koalas - they go great with Bacon.

GeneralRe: Conditionals Pin
Ian H. Davids19-Jan-09 17:55
Ian H. Davids19-Jan-09 17:55 
GeneralRe: Conditionals Pin
John M. Drescher20-Jan-09 3:14
John M. Drescher20-Jan-09 3:14 
GeneralRe: Conditionals Pin
Jeremy Falcon20-Jan-09 6:35
professionalJeremy Falcon20-Jan-09 6:35 
JokeA missing option: I never use conditionals Pin
Nemanja Trifunovic19-Jan-09 3:49
Nemanja Trifunovic19-Jan-09 3:49 
GeneralRe: A missing option: I never use conditionals Pin
lepipele19-Jan-09 4:53
lepipele19-Jan-09 4:53 
GeneralRe: A missing option: I never use conditionals Pin
ciricivan19-Jan-09 5:49
ciricivan19-Jan-09 5:49 
GeneralRe: A missing option: I never use conditionals Pin
lepipele19-Jan-09 5:53
lepipele19-Jan-09 5:53 
GeneralWell PinPopular
#realJSOP19-Jan-09 2:34
mve#realJSOP19-Jan-09 2:34 
GeneralRe: Well Pin
peterchen19-Jan-09 3:17
peterchen19-Jan-09 3:17 
GeneralRe: Well Pin
Dan Suthar19-Jan-09 3:51
professionalDan Suthar19-Jan-09 3:51 
GeneralRe: Well Pin
Mohm'ed Melhem19-Jan-09 8:11
professionalMohm'ed Melhem19-Jan-09 8:11 
GeneralDepends on the situation Pin
peterchen19-Jan-09 2:33
peterchen19-Jan-09 2:33 
GeneralInfidel! You return more than once from a routine! Pin
jhwurmbach19-Jan-09 3:07
jhwurmbach19-Jan-09 3:07 
GeneralRe: Infidel! You return more than once from a routine! Pin
peterchen19-Jan-09 3:15
peterchen19-Jan-09 3:15 
GeneralRe: Depends on the situation Pin
sashoalm19-Jan-09 4:19
sashoalm19-Jan-09 4:19 
GeneralRe: Depends on the situation Pin
Shog919-Jan-09 4:39
sitebuilderShog919-Jan-09 4:39 
GeneralIt depends Pin
Graham Shanks19-Jan-09 2:25
Graham Shanks19-Jan-09 2:25 

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.