15,943,008 members

Survey Results

In which order do you test conditionals?   

Survey period: 19 Jan 2009 to 26 Jan 2009

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

 Option Votes % Always `if (statement is true) then... ` 429 20.32 Always `if (statement is false) then...` 57 2.70 It specifically depends on the situation 1,421 67.31 Random. 48 2.27 I"ve never actually thought about it 156 7.39 Total 2,111 100%

 Re: Depends... DrWheetos22-Jan-09 12:10 DrWheetos 22-Jan-09 12:10
 THEN ? W∴ Balboos, GHB20-Jan-09 2:01 W∴ Balboos, GHB 20-Jan-09 2:01
 Re: THEN ? PIEBALDconsult20-Jan-09 6:24 PIEBALDconsult 20-Jan-09 6:24
 Shurely shome mishtake... Rob Grainger19-Jan-09 22:35 Rob Grainger 19-Jan-09 22:35
 Re: Shurely shome mishtake... W∴ Balboos, GHB20-Jan-09 1:59 W∴ Balboos, GHB 20-Jan-09 1:59
 Re: Shurely shome mishtake... Rob Grainger20-Jan-09 7:07 Rob Grainger 20-Jan-09 7:07
 In which order do you test conditionals TomS4519-Jan-09 16:22 TomS45 19-Jan-09 16:22
 I was taught and have taught that your code should test for the most likely condition first, thus avoiding unneccessary excution of code. If the False state is the more likely, then test for false and avoid testing for True - use the else clause for that. The case should be never used to test for just true/false. Speaking of Case, test in descending order of expected frequency of occurance. Been doin' this for too long!
 Re: In which order do you test conditionals Jeremy Falcon20-Jan-09 6:33 Jeremy Falcon 20-Jan-09 6:33
 Huh? PIEBALDconsult19-Jan-09 13:38 PIEBALDconsult 19-Jan-09 13:38
 Re: Huh? hfrmobile19-Jan-09 22:24 hfrmobile 19-Jan-09 22:24
 Re: Huh? Hamed Musavi19-Jan-09 23:44 Hamed Musavi 19-Jan-09 23:44
 Re: Huh? Rob Philpott20-Jan-09 4:47 Rob Philpott 20-Jan-09 4:47
 Re: Huh? PIEBALDconsult20-Jan-09 6:29 PIEBALDconsult 20-Jan-09 6:29
 Re: Huh? Hamed Musavi20-Jan-09 8:08 Hamed Musavi 20-Jan-09 8:08
 Re: Huh? Jeremy Falcon20-Jan-09 6:40 Jeremy Falcon 20-Jan-09 6:40
 Re: Huh? PIEBALDconsult20-Jan-09 7:57 PIEBALDconsult 20-Jan-09 7:57
 Re: Huh? Jeremy Falcon20-Jan-09 9:45 Jeremy Falcon 20-Jan-09 9:45
 Re: Huh? PIEBALDconsult20-Jan-09 12:32 PIEBALDconsult 20-Jan-09 12:32
 Re: Huh? jordan1322-Jan-09 5:09 jordan13 22-Jan-09 5:09
 Use a CASE tool to do the job right Stuart Cox19-Jan-09 5:47 Stuart Cox 19-Jan-09 5:47
 Re: Use a CASE tool to do the job right Dave Sexton19-Jan-09 6:37 Dave Sexton 19-Jan-09 6:37
 Re: Use a CASE tool to do the job right Stuart Cox19-Jan-09 6:42 Stuart Cox 19-Jan-09 6:42
 Re: Use a CASE tool to do the job right firegryphon19-Jan-09 13:02 firegryphon 19-Jan-09 13:02
 Re: Use a CASE tool to do the job right W∴ Balboos, GHB20-Jan-09 1:54 W∴ Balboos, GHB 20-Jan-09 1:54
 Re: Use a CASE tool to do the job right Dave Sexton20-Jan-09 2:00 Dave Sexton 20-Jan-09 2:00
 Last Visit: 31-Dec-99 18:00     Last Update: 20-Jul-24 11:58 Refresh ᐊ Prev12345 Next ᐅ