Click here to Skip to main content
15,888,461 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to avoid if else... Pin
harold aptroot12-Jun-09 4:05
harold aptroot12-Jun-09 4:05 
AnswerRe: How to avoid if else... Pin
KarstenK12-Jun-09 4:21
mveKarstenK12-Jun-09 4:21 
AnswerRepost Pin
led mike12-Jun-09 4:23
led mike12-Jun-09 4:23 
GeneralRe: Repost Pin
vikasvds14-Jun-09 21:48
vikasvds14-Jun-09 21:48 
GeneralRe: Repost Pin
led mike15-Jun-09 5:10
led mike15-Jun-09 5:10 
AnswerRe: How to avoid if else... Pin
molesworth12-Jun-09 4:30
molesworth12-Jun-09 4:30 
GeneralRe: How to avoid if else... Pin
led mike12-Jun-09 4:35
led mike12-Jun-09 4:35 
GeneralRe: How to avoid if else... Pin
molesworth12-Jun-09 6:19
molesworth12-Jun-09 6:19 
led mike wrote:
The more paths through a program the less likely the program is to be correct


Aye, that's very true, and anything that can reduce complexity will also reduce the likelihood of bugs, and improve readability and, more importantly, testability.

However, sometimes there's no way to improve on an if/else construct, and when used sensibly they're the right tools for the job. When you get into a morass of nested if/elseif/elseif... blocks, then you certainly do introduce problems.

Sheesh! Next thing you'll be telling me "goto" is a bad idea Smile | :)

There are three kinds of people in the world - those who can count and those who can't...

JokeRe: How to avoid if else... Pin
CPallini12-Jun-09 6:42
mveCPallini12-Jun-09 6:42 
GeneralRe: How to avoid if else... Pin
led mike12-Jun-09 8:23
led mike12-Jun-09 8:23 
GeneralRe: How to avoid if else... Pin
CPallini12-Jun-09 22:39
mveCPallini12-Jun-09 22:39 
GeneralRe: How to avoid if else... Pin
led mike15-Jun-09 5:08
led mike15-Jun-09 5:08 
GeneralRe: How to avoid if else... Pin
CPallini15-Jun-09 8:39
mveCPallini15-Jun-09 8:39 
GeneralRe: How to avoid if else... Pin
Lutosław12-Jun-09 8:31
Lutosław12-Jun-09 8:31 
QuestionRe: How to avoid if else... Pin
CPallini12-Jun-09 5:46
mveCPallini12-Jun-09 5:46 
AnswerRe: How to avoid if else... Pin
vikasvds15-Jun-09 2:32
vikasvds15-Jun-09 2:32 
JokeRe: How to avoid if else... Pin
CPallini15-Jun-09 2:59
mveCPallini15-Jun-09 2:59 
GeneralRe: How to avoid if else... Pin
Arun Singh K13-Jun-09 1:18
Arun Singh K13-Jun-09 1:18 
GeneralRe: How to avoid if else... Pin
vikasvds14-Jun-09 21:30
vikasvds14-Jun-09 21:30 
GeneralRe: How to avoid if else... Pin
vikasvds14-Jun-09 21:32
vikasvds14-Jun-09 21:32 
QuestionHow to get data from user during run time? Pin
kapardhi12-Jun-09 3:04
kapardhi12-Jun-09 3:04 
QuestionRe: How to get data from user during run time? Pin
David Crow12-Jun-09 3:08
David Crow12-Jun-09 3:08 
AnswerRe: How to get data from user during run time? Pin
kapardhi12-Jun-09 3:11
kapardhi12-Jun-09 3:11 
AnswerRe: How to get data from user during run time? Pin
David Crow12-Jun-09 3:14
David Crow12-Jun-09 3:14 
GeneralEven better! Pin
CPallini12-Jun-09 3:23
mveCPallini12-Jun-09 3:23 

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.