if (continuing && NULL != foo->loldongs )
{
perform_dickbutt();
} PROLINT argues that foo might be NULL in the second if YET IT OBVIOUSLY CAN'T because continuing equals zero and the right hand term of && isn't evaluated at all.
>>9
dick butt *x = new dick butt(31337);
printf("%d", x);
Name:
OP2008-10-17 4:23
>>6
The point is, you can have an arbitrary amount of sanity checks in the beginning of the function and use the continuing variable to keep track of the status. The two other, and worse, methods are to have a shitload of nested ifs or goto errors.
Name:
Anonymous2008-10-17 8:36
>>10 goto considered better than state variables emulating goto.
Name:
Anonymous2008-10-17 10:15
>>10
I have a variable named errstr and label error in a lot of my functions. Then I use macro EXPECT(code,cause), which sets errstr to cause and jumps to label error if code evaluates to false value.
This looks waaaaaay better than shitload of nested ifs or your continuations