Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • Some of the "cons" may at times be pros. For example, suppose a piece of code has eight consecutive operations of the form if (x > maxX) {x=maxX; peggedAny = true;}. If each such operation will fit easily on a single line, I would rather have eight lines like that than dozens of lines which split out the statements. If such comparisons were used in enough places, four statements of the form peggedAny |= pegValueMinMax(ref x, minX, maxX); might be better, but someone reading that would have to read pegValueMinMax to see what it does. Commented Jul 15, 2014 at 17:54
  • Further, if a small piece of a line changes, a "diff" will regard that as a change to the whole line. If the line should behave functionally as a unit, that would be a good thing. Otherwise, if a semantic operation is split among multiple lines, changes to some lines might affect the operation in ways which would not be apparent. Commented Jul 15, 2014 at 17:58
  • It's not easier to read something horizontally - we read code from top to bottom. It's common for developers to split the code window vertically when working on multiple files, which introduces an issue was developers are then forced to scroll horizontally in order to read a line of code. Commented Nov 17, 2022 at 12:30