Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

wrong:
void func(...)
{
        int rc;
        struct foobar_counter *foo;
        unsigned long last;


All lines should wrap at 80 100 characters. This is to avoid the need to have extra-wide terminal windows for the few lines of code that exceed 80 100 columns, and avoids nesting functions and conditionals too deeply. If it's getting too hard to wrap at 80 100 characters, you probably need to rearrange conditional order or break it up into more functions.

...

Code can be much more readable and efficient if the simple or common actions are taken first in a set of tests. Re-ordering conditions like this also eliminates excessive nesting and helps avoid overflowing the 80100-column limit.

Do not place else blocks after terminal statements like returncontinuebreak, or goto in the if block.

...