I think of paragraph breaks, periods, semicolons, and commas in terms of clustering; a pair of thoughts is very closely related if they’re separated only by a comma, and progressively less related if they’re separated by an emdash, semicolon, period, or paragraph break (in that order, from most to least related). If a paragraphs is too long, promote the periods which separate the least-related thoughts to paragraph breaks; if a sentence is too long, promote a semicolon, emdash or comma and adjust the grammar if needed. Conversely, if paragraphs or sentences are too short, demote from paragraph break to period and from period to semicolon.
In programming, the hierarchy instead is unspaced operator, spaced operator, semiblank line, blank line. A semiblank line is a line with only an open or close curly brace or parenthese. A spaced operator is one that looks like x + y, an unspaced operator is one that looks like x+y; and function calls can also be spaced or unspaced, eg f( x ) vs f (x) vs f(x), all of which are used in practice. The spacing hierarchy can never disagree with the order of operations.
I think of paragraph breaks, periods, semicolons, and commas in terms of clustering; a pair of thoughts is very closely related if they’re separated only by a comma, and progressively less related if they’re separated by an emdash, semicolon, period, or paragraph break (in that order, from most to least related). If a paragraphs is too long, promote the periods which separate the least-related thoughts to paragraph breaks; if a sentence is too long, promote a semicolon, emdash or comma and adjust the grammar if needed. Conversely, if paragraphs or sentences are too short, demote from paragraph break to period and from period to semicolon.
In programming, the hierarchy instead is unspaced operator, spaced operator, semiblank line, blank line. A semiblank line is a line with only an open or close curly brace or parenthese. A spaced operator is one that looks like x + y, an unspaced operator is one that looks like x+y; and function calls can also be spaced or unspaced, eg f( x ) vs f (x) vs f(x), all of which are used in practice. The spacing hierarchy can never disagree with the order of operations.