Liste des Groupes | Revenir à cl c |
On 27/02/2025 06:57, Janis Papanagnou wrote:[...]On 26.02.2025 20:56, David Brown wrote:On 26/02/2025 18:13, Janis Papanagnou wrote:On 26.02.2025 17:32, David Brown wrote:On 26/02/2025 15:39, Bradley K. Sherman wrote:Just do your best to keep it neat and under 80 columns.
>
>
Since decades now there are no such hard limits, so why do you make
up such a statement.
That's exactly the point - there /are/ no real hard limits, and have not
been any since we moved on from pure text-mode terminals. Some
situations have short line limits (such as for a slideshow in a
presentation), most situations for normal coding can be as wide as the
developer finds convenient.
So why do some people think that 80 columns should be a hard limit to
their line length? They do not, for the most part, think 80 characters
is ideal for readability, or for display, or for printing, or for
writing code, or for reviewing it, or for any other use. For the most
part, they don't think at all. They simply regurgitate 80 columns
because IBM picked 80 columns as the width of punched cards in 1928. If
IBM had picked 72 columns or 96 columns, Bradley would have written
"Just do your best to keep it neat and under 72 columns" or "Just do
your best to keep it neat and under 96 columns".
[...]
In newspapers you can find articles that can span even a whole page.
It's nonetheless organized in small columns.
Of course different newspapers do things differently.
And maybe there are other reasons for having columns that are often far
too narrow for legibility, sometimes leading to horrible inconsistent
spacing, really messy hyphenation, and the like.
Columns are clearly required for newspapers - the pages are (usually)
far too wide to be comfortable to read without splitting up into
columns. The question is what width they should be.
Generally, around 60 - 70 characters is common for quick, easy reading,
such as most books. Technical documents can have a good deal more - a
quick check suggests that the C standards have around 90 characters per
line, while the C++ standards (with a smaller typeface) have about 105.
A technical white paper that I happen to have open at the moment has 120
character lines.
Newspaper columns are often much shorter - 30 to 40 characters. So why
is that?
The prime purpose of a newspaper is, obviously, to make money. The more
you put in the same area, the better. Having regular column sizes
reduces costs (especially before computer-based layout and printing). It
makes it easier to sell advertising space.
Modern newspapers can be more flexible in their layouts, but keeping a
familiar look is important. Legibility of individual columns of text is
much less important - after all, most readers scan headlines and only
read a small proportion of the column text.
>
These numbers appear strange to me. - A quick look into a couple of
different editions show more like 45-90 characters, with typical
values around 55-70 (including spaces counted as characters), i.e.
not in the extreme ranges. For these numbers I've inspected random
books written in different layouts, in three different languages,
and of different types. - I would be very astonished if that would
be fundamentally different in your language domain, but YMMV.
>
What did you actually look at? Novels? Textbooks? Documents written
for A4 page sizes? Newspapers? Old legal documents?
So I have to conclude that printed typical text would fit regularly
and easily in an 80 column mono-spaced medium.
>
Your conclusion would be wrong, unless you are limiting it to specific
areas. (The word "typical" is very vague.)
>
It's not about "small screens"; it's about readability as being a
function of the used line-length. But readability, while probably
a most important factor, is not the only aspect...
>
I agree that readability is key here. But remember that readability of
code is not the same thing as readability of prose.
Doing too much in
one line of code makes it hard to understand - regardless of how many
characters it actually uses.
Taking something that is logically one
operation or expression and artificially splitting it into two (or more)
lines to suit an arbitrary line length limit also makes the code hard to
understand. [...]
Myself I usually operate on a minimum of two physical screens, and
(with my font setting) each one capable of displaying two 80-column
windows side by side.
That seems small to me.
I have no problem with two approximately
120-column windows side-by-side in my IDE,
along with all the additional
junk - file lists, code outlines, line numbers, scroll bars, etc.
Sometimes I will have three files side-by-side, with a bit less space
for the junk, depending on what I am doing. (I usually have other stuff
like command windows, serial terminals, webpages, documents, etc., on
the other screens.)
[...]
Sure. I do the same, for the same reasons. But I don't restrict myself
to so short line lengths. (Of course most of the lines in my code are
shorter than 80 characters.)
Les messages affichés proviennent d'usenet.