Timeline for Which way of writing a conditional test is the most readable?
Current License: CC BY-SA 3.0
        13 events
    
    | when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jan 7, 2017 at 6:42 | vote | accept | osman Rahimi | ||
| Jan 3, 2017 at 17:31 | history | edited | Jamal | CC BY-SA 3.0 | 
        
            
             
                
                    deleted 3 characters in body 
                
             
        
     | 
| Jan 3, 2017 at 16:10 | answer | added | user378230 | timeline score: 3 | |
| Jan 3, 2017 at 15:53 | answer | added | Philip Rollins | timeline score: 1 | |
| Jan 3, 2017 at 15:05 | comment | added | 200_success | Please state the purpose of this code in the title, as required by the How to Ask guidelines. Also provide adequate context (ideally an entire function or class) so that we may advise you properly. What are these flags in the code? | |
| Jan 3, 2017 at 14:48 | history | edited | t3chb0t | 
        
            
             
                
                    edited tags 
                
             
        
     | 
|
| Jan 3, 2017 at 14:46 | history | edited | JanDotNet | CC BY-SA 3.0 | 
        
            
             
                
                    fixed typo in code 
                
             
        
     | 
| S Jan 3, 2017 at 14:42 | history | suggested | Cody Gray | CC BY-SA 3.0 | 
        
            
             
                
                    Improve title, code formatting, and grammar. I've fixed the code's indentation here because I *think* it is just unfamiliarity with the code-formatting toolbar button, rather than something that actually needs to be commented upon in a review. 
                
             
        
     | 
| Jan 3, 2017 at 14:28 | review | Suggested edits | |||
| S Jan 3, 2017 at 14:42 | |||||
| Jan 3, 2017 at 13:43 | comment | added | radarbob | Write the condition in terms of what it means in terms of your business rules, problem domain, user perspective. Next I'd have a final "else" if only to trap errors. Next, #2 is the worst of the 3 for readability. #3 is next worst - "isAdd"; add what? Again, use the "business" terminology. | |
| Jan 3, 2017 at 13:29 | answer | added | JanDotNet | timeline score: 7 | |
| Jan 3, 2017 at 13:21 | review | First posts | |||
| Jan 3, 2017 at 17:09 | |||||
| Jan 3, 2017 at 13:18 | history | asked | osman Rahimi | CC BY-SA 3.0 |