Sujet : Re: Which code style do you prefer the most?
De : Keith.S.Thompson+u (at) *nospam* gmail.com (Keith Thompson)
Groupes : comp.lang.cDate : 04. Mar 2025, 00:23:52
Autres entêtes
Organisation : None to speak of
Message-ID : <8734ftn1fb.fsf@nosuchdomain.example.com>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14
User-Agent : Gnus/5.13 (Gnus v5.13)
scott@slp53.sl.home (Scott Lurndal) writes:
Tim Rentsch <tr.17687@z991.linuxsc.com> writes:
[...]
The reasoning here is backwards. The choice of 80 columns wasn't
made to accommodate a given aspect ratio; rather, the choice of
screen width was made to accommodate 80 columns. Furthermore the
choice of 80 columns was not plucked out of thin air, or made to
fit some accidental hardware constraint; rather, the choice of 80
columns was made to provide a suitable width for a single line, and
hardware was designed around that.
>
Specifically around the number of columns on a punched card, which
had been used for programming for years before video terminals
were common. In 1982, I visited a Sperry-Univac office in Clear
Lake, Ia and they were still mostly programming with cards - they
had a couple of video terminals on carts that were shared, but
they had far more than two programmers competing for them.
And the physical size of the cards was select to match the size of US
currency at the time Hollerith cards were invented (1862-1923; modern US
currency is not the same size). This was so that the cards could be
used with the same equipment used to handle currency.
IBM developed 80-column cards, with the same overall size, in the late
1920s. Apparently 80 just happened to be the number of rectangular
holes that could reasonably be accommodated (and it's a nice round
number). And 80-column video terminals were baed on card sizes (though
I think some earlier terminals had 40 columns).
Source: <
https://en.wikipedia.org/wiki/Punched_card>
I'll just note that the fact that 80 is an arbitrary number, based on
technologies we no longer use, doesn't automatically mean that it's a
bad rule of thumb for line length. I'm writing this message in a window
that's 159 columns wide, but I still keep text a bit shorter than 80
columns, out of old habit and/or because I find it easier to read. Most
of my code (include C code, so we're still topical) is also under 80
columns, but I'm not quite as strict about that.
[...]
-- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.comvoid Void(void) { Void(); } /* The recursive call of the void */