A Mere 80 Columns
I've got this philosophy (yes, we're old enough now to have developed entire philosophies):
Axiom one: that the "narrative arc" of a computer program is told in lines of code; that is, generally one
thing happens per line. Call f(). Call g(). For i = 1 to 10 and call
h(i) on the next line, etc.
Sure, you can put multiple statements on a single line:
f(); g(); for (i = 1; i <= 10; ++i) h(i);
But that's rare. One statement per line, one line per statement. Usually.
Axiom two: code is read more than it's written. Therefore, anything we can do to make it easier to read the code, the better: good comments, proper formatting, all that jazz. Even if it's your own code, you may find yourself reading it years later and wondering, "What the heck was I thinking?"
Importantly, if you can fit a function or data structure or what-have-you into a single "screen"—without scrolling—you've got a better chance at comprehending what you're seeing. Axiom two.
Now, put those two axioms together! Conclusion: Saving vertical space is usually a good idea!
So you'll find my style often converges on that: putting multiple imports on a single line, skipping the braces for single-statement blocks, etc., but especially using more than 80 columns means that hairy function calls like
if (meaningPercentage < 0.55) {
console.log("This is a bit of a slog.");
slog_percentage(
meaningPercentage,
"Meaning",
"The meaning percentage is a measurement of the "
" meaningfulness of the parameter and is required",
xCoord / 9.0,
yCoord > 5.0? yCoord : yCoord * 2.0,
zCoord - zOrigin,
(xCoord + yCoord + zCoord) / 3.0,
(xCoord + yCoord + zCoord) / 3.0,
);
} else {
console.log("Acceptable meaning determined);
}
which is 17 SLOC I write as:
if (meaningPercentage < 0.55) {
console.log("This is a bit of a slog.");
slog_percentage(
meaningPercentage, "Meaning",
"The meaning percentage is a measurement of the meaningfulness of the parameter and is required",
xCoord / 9.0, yCoord > 5.0? yCoord : yCoord * 2.0, zCoord - zOrigin,
(xCoord + yCoord + zCoord) / 3.0, (xCoord + yCoord + zCoord) / 3.0,
);
} else {
console.log("Acceptable meaning determined);
}
which is 11 SLOC—and made possible by going widescreen!
Besides, 80 columns is an ancient punch-card standard, and "tradition" is just peer-pressure from dead people.