Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Why do people do this?

Name: Anonymous 2012-07-04 4:24

Why write this

int foo() {
    int rc;

    rc = bar();
    if( rc < 0 ) {
        report_error();
        return -1;
    }

    return 0;
}



if this is much clearer to read?

int foo() {
    int rc;

    rc = bar();
    if( rc >= 0 )
        return 0;

    report_error();
    return -1;
}

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List