I think then we are all agreed that the format is

/* comment */
if (...) {
    ...
}
/* comment */
else {
    ...
}

with mandatory {}s.

For completeness, we should also include chained else-ifs; I think the
following is reasonably uncontroversial:


/* comment */
if (...) {
    ...
}
/* comment */
else if (...) {
    ...
}
/* comment */
else {
    ...
}

The one thing I'm not sure about is whether we should mandate where the
comments go.  For example, I personally Iike comments before the
conditional describing the condition, and/or comments after describing
the action:

/* stack full ? */
if (ix > max_ix) {
    /* allocate more */
    ....
}
else {
    /* push the thinggy */
    ....
}

So, do we mandate or not, and if yes, what style?

Dave M.

Reply via email to