Click here to Skip to main content
15,892,059 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Help in MDI (reply needed as soon as possible) Please.. Pin
Ruchit Sharma13-Jan-04 1:21
Ruchit Sharma13-Jan-04 1:21 
QuestionHow to write ftp server and client for windows in c Pin
shan1213-Jan-04 0:22
shan1213-Jan-04 0:22 
AnswerRe: How to write ftp server and client for windows in c Pin
Selvam R13-Jan-04 1:05
professionalSelvam R13-Jan-04 1:05 
QuestionHow to fix this? Pin
Anthony_Yio13-Jan-04 0:08
Anthony_Yio13-Jan-04 0:08 
AnswerRe: How to fix this? Pin
Prakash Nadar13-Jan-04 0:13
Prakash Nadar13-Jan-04 0:13 
GeneralRe: How to fix this? Pin
Anthony_Yio13-Jan-04 0:24
Anthony_Yio13-Jan-04 0:24 
AnswerRe: How to fix this? Pin
jhwurmbach13-Jan-04 0:23
jhwurmbach13-Jan-04 0:23 
GeneralDifference between nested conditional statements vs non-nested dito Pin
Anonymous12-Jan-04 23:52
Anonymous12-Jan-04 23:52 
Hi!

What is the computational difference between nested conditional statements and non-nested dito?

When I have lots of sequential conditions, for the sake of readability I tend to write
void SomeFunction()
{
    // The first condition must be true to continue.
    if(!conditionA) return;
 
    ... // Some processing is done here.
 
    // The second condition must be true to continue.
    if(!conditionB) return;
 
    ... // Some processing is done here.
 
    // The third condition must be true to continue.
    if(!conditionC) return;
 
    ... // Some processing is done here.
}
instead of
void SomeFunction()
{
    // The first condition must be true to continue.
    if(conditionA)
    {
        ... // Some processing is done here.
 
        // The second condition must be true to continue.
        if(conditionB)
        {
            ... // Some processing is done here.
 
            // The third condition must be true to continue.
            if(conditionC)
            { 
                ... // Some processing is done here.
            }
            else 
            { 
                return; 
            }
        }
        else 
        { 
            return; 
        }
    } 
    else 
    { 
        return; 
    }
}
Are there any performance issues, stack mumbo jumbo or something else that could be interesting to know about that make these two ways of writing different?
GeneralI asked the question, not Anonymous... Pin
Johann Gerell12-Jan-04 23:55
Johann Gerell12-Jan-04 23:55 
GeneralRe: Difference between nested conditional statements vs non-nested dito Pin
Prakash Nadar13-Jan-04 0:07
Prakash Nadar13-Jan-04 0:07 
GeneralRe: Difference between nested conditional statements vs non-nested dito Pin
Anthony_Yio13-Jan-04 0:14
Anthony_Yio13-Jan-04 0:14 
GeneralRe: Difference between nested conditional statements vs non-nested dito Pin
berndg13-Jan-04 2:16
berndg13-Jan-04 2:16 
GeneralRe: Difference between nested conditional statements vs non-nested dito Pin
Johann Gerell13-Jan-04 22:28
Johann Gerell13-Jan-04 22:28 
GeneralRe: Difference between nested conditional statements vs non-nested dito Pin
berndg15-Jan-04 3:51
berndg15-Jan-04 3:51 
GeneralRe: Difference between nested conditional statements vs non-nested dito Pin
jhwurmbach13-Jan-04 0:26
jhwurmbach13-Jan-04 0:26 
GeneralI hate First-chance exceptions !!! Pin
Danoo12-Jan-04 23:31
Danoo12-Jan-04 23:31 
GeneralRe: I hate First-chance exceptions !!! Pin
Anthony_Yio13-Jan-04 0:02
Anthony_Yio13-Jan-04 0:02 
GeneralRe: I hate First-chance exceptions !!! Pin
Michael P Butler13-Jan-04 1:03
Michael P Butler13-Jan-04 1:03 
GeneralRe: I hate First-chance exceptions !!! Pin
Ernesto D.14-Jan-04 11:32
Ernesto D.14-Jan-04 11:32 
GeneralRe: I hate First-chance exceptions !!! Pin
Michael P Butler14-Jan-04 20:50
Michael P Butler14-Jan-04 20:50 
GeneralRe: I hate First-chance exceptions !!! Pin
Ernesto D.18-Jan-04 17:04
Ernesto D.18-Jan-04 17:04 
GeneralI/O Text Files Pin
Zero Nova12-Jan-04 23:19
Zero Nova12-Jan-04 23:19 
GeneralRe: I/O Text Files Pin
Antti Keskinen13-Jan-04 3:27
Antti Keskinen13-Jan-04 3:27 
Generalwhere i get exact downloadable link of msdn library Pin
Rajesh match12-Jan-04 23:03
Rajesh match12-Jan-04 23:03 
GeneralRe: where i get exact downloadable link of msdn library Pin
Prakash Nadar13-Jan-04 0:11
Prakash Nadar13-Jan-04 0:11 

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.