Sujet : Re: Which code style do you prefer the most?
De : tr.17687 (at) *nospam* z991.linuxsc.com (Tim Rentsch)
Groupes : comp.lang.cDate : 09. Mar 2025, 20:18:39
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <8634fmui5s.fsf@linuxsc.com>
References : 1 2 3 4 5 6 7
User-Agent : Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
scott@slp53.sl.home (Scott Lurndal) writes:
David Brown <david.brown@hesbynett.no> writes:
>
On 26/02/2025 15:39, Bradley K. Sherman wrote:
>
Just do your best to keep it neat and under 80 columns.
>
Neat, yes. 80 columns, no - unless you are living in the previous
century.
>
Lines that are too long are hard to read, but the idea that 80
columns is a good number or should be a hard limit is /long/
outdated. [...]
These statements exemplify the sort of tripe offered by people who
have strong opinions but no facts. Proof by innuendo.
I tend to prefer the 80 column constraint. I use vim with both
horizontal and vertical splits to work on a codebase with several
hundred source files; 80-column lines are much easier to read in
that environment, where each split may only be 80 columns wide
with two or three vertical splits available on a wide (16x9)
screen.
>
Makes it easly to move between files/splits using the keyboard,
especially useful over ssh.
I often read code on 8.5 by 11 paper. I find using that medium
gives me a wider focus, and lets me understand how code fits
together on a large scale, better than looking at code on a
display, even a very large one. Having more than 80 columns per
line when using a paper medium makes the characters smaller, and
IME increases the amount of effort and energy needed when reading,
which consequently limits the amount of time I can spend reviewing
and understanding code. There are other reasons to want to limit
line lengths to something near 80 columns, but the effect of output
on standard paper media is one of the most compelling.