3 ms·
My personal impression from these examples you gave is that line-breaking inside an arithmetic expression is generally a horrible idea. If you have something li
by majewsky 6y ago
My personal impression from these examples you gave is that line-breaking inside an arithmetic expression is generally a horrible idea. If you have something like
let result = (first_long_variable + second_long_variable) * (third_long_variable + fourth_long_variable);
My position is that the only way to make this look good under a line length limit is
let factor1 = first_long_variable + second_long_variable;
let factor2 = third_long_variable + fourth_long_variable;
let result = factor1 * factor2;
(where of course `factor1` and `factor2` would be given names that make sense in context)