On 2022-04-19 0:58, Thomas wrote:
> hi :-)
>
>
> how do you set your max line length?
>
> using indentations a lot, i find that 80 is short.
I limit lines to 80 characters, because I very often want to use a
side-by-side diff of file versions, which means having a window wider
than two line-lengths. Text in a 170-character-wide window is still
readable, but wider ones are not, for me as an older guy with stiff
eye-lenses.
To make do with 80-character lines, I often use local or partial
use-clauses, and I divide long calls across many lines, usually having
only one parameter per line. By a "partial use clause" I mean, for
example, "use Interfaces", when I really need to use Interfaces.C, so I
still have to qualify with "C.zzz" but not with "Interfaces.C.zzz".
I also group subsystems into package families (parent and child
packages) which means that the children can directly use parent-declared
identifiers without qualification.
Other means to keep lines short include using a small indentation step
(I now use 3 spaces, but I'm considering changing to 2 spaces) and
keeping subprograms short, which also helps the readability.