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

Code from others

Name: Anonymous 2010-10-01 12:09

We all read a lot of code. Post some lines that lets you always facepalm. Example:


bool some_funtion(...)
{
    ...
    ...

    if ( other_func() && something_else )
        return true;
    else
        return false;
}

Name: Anonymous 2010-10-01 13:07

No examples to hand, but mainly it's when people have duplicated some code that should have really been refactored to have a common function that handles both scenarios.  It just seems so obvious. I believe that code should as small and simple as possible, not for optimization, but the simpler it is, the nicer it is to maintain

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