Code /

Programming Notes





edit SideBar

Programming Notes

Subdividing common headers

  • Less merging
  • Fewer build dependencies

Error handling

As return value

ERRCODE child()
{
    ERRCODE err = NO_ERR;
    ...
    return err;
}

ERRCODE parent()
{
    ERRCODE err = NO_ERR;
    err = child();
    ...
    return err;
}

As var parameter

void child(ERRCODE* err)
{
    err = NO_ERR;
    ...
}

void parent(ERRCODE* err)
{
    child(err);
    if (err == NO_ERR)
    {
        child2(err);
    }
}

Is there significant overhead in the first case from stack allocation for autos?

Headers

  • One header per interface
Recent Changes (All) | Edit SideBar Page last modified on 02 June 2008, at 10:19 AM UTC Edit Page | Page History
Powered by PmWiki