3 ms·
// Presumably refactored from processSomething(x, y, z, getSomething()) because the line got too long. var something = getSomething(); processSomething(x,
by bsder 7y ago
// Presumably refactored from processSomething(x, y, z, getSomething()) because the line got too long.
var something = getSomething();
processSomething(x, y, z, something);
Sigh, people will add extra lines, refactor and risk introducing bugs simply to avoid a text line longer than a punch card from 1965.
- kjeetgill 7y agoYou gotta have a soft limit somewhere. I'll concede 80 characters or even 100 but 120 seems fair enough.
- lugg 7y agoI've always used a soft limit of 120. I use it as an indicator that I am either nested too deeply or my functions have too many parameters. Or just in general my code is too complex / hard to read after the fact. Sometimes things call to break the soft limit that is fine, it's only a signal of potential problems, not an indicator of definite problems. And fwiw, if you can't refactor like that without concern it's a language design failure. A pretty big one actually.
- mikekchar 7y agoMy terminal width is about 120 characters because my vision is poor enough that this is how many character fit on my monitor horizontally. I appreciate coding standards that limit the width of a line of code because it makes it considerably more accessible for me. Programmers with poor vision aren't that uncommon -- it's not completely out of the question that your team will hire one some day.