3 ms·
If I'm intentionally writing a one-line if I will write it on one line. I think using an indented second line without braces is less clear, and more prone to p
by ams6110 14y ago
If I'm intentionally writing a one-line if I will write it on one line. I think using an indented second line without braces is less clear, and more prone to problems later when the code is modified.
So I'd write:
if (max > 0) printf("%s", longest);
or
if (max > 0) {
printf("%s", longest);
}
but never
if (max > 0)
printf("%s", longest);