Liste des Groupes | Revenir à cl c |
On 26.02.2025 20:56, David Brown wrote:Ah, okay, I see what you mean. Yes, I used "emotive language" to emphasise my dislike for decisions that are based /solely/ on "we've always done it that way" or "that's what other people do". These can be relevant factors in a decision - there's always a cost in changing things or picking unusual solutions, and that must be weighed against benefits from doing things differently. But they should not be overriding factors - unfortunately, often people treat them that way.On 26/02/2025 18:13, Janis Papanagnou wrote:Wherever and whenever it originated is not the question. - Here I wasOn 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.>
>
Neat, yes. 80 columns, no - unless you are living in the previous
century.
That's the typical response of someone who obviously doesn't care. :-/
>
I care about legibility of code, and convenience of working with it. I
don't care how well it fits in a text-only screen that is limited by
ancient hardware.
just pointing out that "living in the previous century" is a typical
response of someone who obviously isn't much interested in rationales
and in discussions of these. We've heard that regularly, just recently
for example in context of "ancient editors". If there were interest we
would discuss it differently.
So lets see what follows... :-)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.
I do plenty from the command-line, but if I amYes, I agree.
working with a file from the command line, it is almost invariably under
a gui - terminal windows can be sized for convenience.
>>[...]>
This sounds more reasonable. :-)
>
[...]
Too long lines are hard to read. Too short lines are hard to read.
80 columns is not a terrible choice, but it is too often too short,Since decades now there are no such hard limits, so why do you make
especially if you try to view it as a hard limit.
up such a statement.
It /does/ hold as a general truth, with the implicit context added.Yes, as a rule of thumb, I agree.[...]>
Too short identifiers are bad - too long identifiers are bad.
Though it doesn't hold as sort of a general truth, because...
OK.>...of that. - I agree.
Generally, identifier length should be roughly related to the size of
their scope.
>I take this as your opinion.From typesetting we know that long lines are bad to read; why are>
the newspaper columns so narrow?
Newspaper columns are hard to read well - they are narrow because
newspapers are often trying to put a lot of stuff on one page despite it
being less legible.
What did you actually look at? Novels? Textbooks? Documents written for A4 page sizes? Newspapers? Old legal documents?>Right.
The "ideal" length for prose will vary depending on the kind of text,
the language, the size and style of the font, the general layout, the
medium, and other factors.
Somewhere between about 60 and 100 characters is typical.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.
So I have to conclude that printed typical text would fit regularlyYour conclusion would be wrong, unless you are limiting it to specific areas. (The word "typical" is very vague.)
and easily in an 80 column mono-spaced medium.
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.>It's not about "small screens"; it's about readability as being aLong lines are even worse to read if you use sans-serif fonts;>
too bad that such bad fonts are dominating our modern world, and
especially in the IT ("thanks" MS for fostering Arial, etc.);
using less columns is also often advantageous here to compensate
the reduced legibility.
Don't expect that everyone has a screen as big as yours; that is
the case in companies but also in other places or projects where
code is shared or where people work together.
>
Shorter line lengths don't make it easier to work on smaller screens. A
smaller screen means less code is visible at a time, regardless of line
length.
function of the used line-length. But readability, while probably
a most important factor, is not the only aspect...
Myself I usually operate on a minimum of two physical screens, andThat 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.)
(with my font setting) each one capable of displaying two 80-column
windows side by side.
I regularly work with more than one text fileSure. 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.)
in parallel, and if there's some source with significantly larger
line width I either have to scroll sidewards of have to accept line
wraps at arbitrary (typically very bad) places with all the negative
effects! It's much better to define the code layout yourself, better
for legibility in the first place, and better to work with available
typical resources.
I haven't suggested that /you/ have such a hard rule.>There was no hard rule as should have been obvious by what I wrote.Myself I have the habit to take an 80 column screen as baseline,>
organize my source code in that frame. But that's no credo; the
purpose is just to not let the lines get too long "by accident".
I then wrap the code at sensible places with indentation. And if
_some_ lines get longer, say your 100 or 120 columns, that's no
problem as long as the overall readability is still guaranteed.
>
Again, preferences vary, here as well.
>
Sure. I am simply arguing against hard and fast rules that are not
based on hard and fast reality.
The 80 column rule [of thumb] is a good (empirical) base; while it80 characters is not the worst rule you could pick, but it is far from optimal for lots of uses - including lots of prose, printed text, online documents, and coding.
may have had its origin in historic hard limits of IT devices (like
VT100 or some such - that, BTW, are also not completely arbitrarily
chosen!) it is also a _sensible value_ given the expertise of the
printed media, and the reality of work (in the IT sector or else).
YMMV.Of course :-)
Les messages affichés proviennent d'usenet.