4 ms·
My rule is that a simple conditional without braces can go on one line: if (not_true) return; Anything longer goes on the next line, within brances.
by cageface 15y ago
My rule is that a simple conditional without braces can go on one line:
if (not_true) return;
Anything longer goes on the next line, within brances.
- ars 15y agoMy rule is if it's all on one line (even if complex) no braces. But if it's two lines, or if there is an else, then put in the braces.