2 ms·
Need? No. Prefer? Yes. foo(True, True) foo(False, True) foo(False, False) foo(True, False) Add a few more parameters, put some arithmetic in ther
by klyrs 5y ago
Need? No. Prefer? Yes.
foo(True, True)
foo(False, True)
foo(False, False)
foo(True, False)
Add a few more parameters, put some arithmetic in there that isn't clearly an unrolled double for-loop. Maintaining repetitive code of that form is easier when the arguments are well aligned. And if you're using an editor with a block-select feature, then this changes from an aesthetic preference into a game-changer when you, say, add or remove an argument to foo.