max line length

124 views
Skip to first unread message

Thomas

unread,
Apr 18, 2022, 5:59:01 PMApr 18
to
hi :-)


how do you set your max line length?

using indentations a lot, i find that 80 is short.
but I don't realize how many people I'm going to disturb if I set a
greater length, because I don't know all your uses.

--
RAPID maintainer
http://savannah.nongnu.org/projects/rapid/

Niklas Holsti

unread,
Apr 19, 2022, 2:38:03 AMApr 19
to
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.

Jeffrey R.Carter

unread,
Apr 19, 2022, 3:30:42 PMApr 19
to
On 2022-04-18 23:58, Thomas wrote:
>
> how do you set your max line length?

I use the Preferences menu selection in my editor. But that's probably not what
you intended to ask. I set mine to 132 characters.

> using indentations a lot, i find that 80 is short.
> but I don't realize how many people I'm going to disturb if I set a
> greater length, because I don't know all your uses.

When I started out, source lines were limited to 80 columns because that was the
length of punched cards, but the line printers could print 132 columns. In the
1980s printing switched from 14 x 11 inch paper in line printers to 8.5 x 11
inch paper, but it was still possible to print 132 characters in landscape mode,
so that's what I used if I had an editor that could handle long lines easily
(screens were not large enough or high enough resolution to be suitable for
reading programs, so I still tended to print them when that was needed. Today
printing is not needed much, but I continue to use 132 columns. If others want a
different line length they may reformat it.

--
Jeff Carter
"If I could find a sheriff who so offends the citizens of Rock
Ridge that his very appearance would drive them out of town ...
but where would I find such a man? Why am I asking you?"
Blazing Saddles
37

Dmitry A. Kazakov

unread,
Apr 19, 2022, 4:07:24 PMApr 19
to
On 2022-04-18 23:58, Thomas wrote:

> how do you set your max line length?

72. I used to program in FORTRAN on punched cards. (:-))

These days I use 3 split GPS windows side by side.

Then I am using the "use" clause, so I do not need a thousand of
characters to just write Z := X + Y; (:-))

> using indentations a lot, i find that 80 is short.

Refactor the code and use local subprograms.

--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

Stephen Leake

unread,
Apr 21, 2022, 7:32:05 PMApr 21
to
Thomas <fantome.foru...@free.fr.invalid> writes:

> how do you set your max line length?

120 chars; I assume readers have a big display like mine.

--
-- Stephe

Stephen Leake

unread,
Apr 21, 2022, 7:34:09 PMApr 21
to
Niklas Holsti <niklas...@tidorum.invalid> writes:

> 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,

I prefer top/bottom diff, partly for this reason.

But my monitor can easily display 240 characters across. And I have good
glasses.

--
-- Stephe

Randy Brukardt

unread,
Apr 22, 2022, 3:57:12 AMApr 22
to
"Stephen Leake" <stephe...@stephe-leake.org> wrote in message
news:86r15qx...@stephe-leake.org...
The diff program I use can scroll sideways if necessary, and so can every
editor I've used since 1985, so this isn't generally an important concern.
The Janus/Ada source used a "soft" limit of 80, mainly because that's what
terminals and PCs displayed back then, but we never broke lines just for
that reason. Typically, the indent is more than the overrun anyway (so that
actual text never exceeded 80 characters). Of course, one has to break
really long calls, like the call to create a window in Claw (which usually
has a dozen or so parameters).

Randy.



>
> --
> -- Stephe


Thomas

unread,
Jul 5, 2022, 10:59:42 AMJul 5
to
In article <t3n4pl$1mcs$1...@gioia.aioe.org>,
"Dmitry A. Kazakov" <mai...@dmitry-kazakov.de> wrote:

> On 2022-04-18 23:58, Thomas wrote:
>
> > how do you set your max line length?
>
> 72. I used to program in FORTRAN on punched cards. (:-))
>
> These days I use 3 split GPS windows side by side.

ok.
i understand that if i set it to 96 and then you'll look at my code
later, you'll be annoyed in this kind of situation.

is it important for you ?

>
> Then I am using the "use" clause

ok, i don't like that very much.

Thomas

unread,
Jul 5, 2022, 11:22:19 AMJul 5
to
In article <jc73m8...@mid.individual.net>,
Niklas Holsti <niklas...@tidorum.invalid> wrote:

> 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,

i would like to set it to 96.

> 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

is a 200-character-wide window bearable?


>
> I also group subsystems into package families (parent and child
> packages) which means that the children can directly use parent-declared
> identifiers without qualification.

thank you, i tend to forget it :-)

>
> 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)

i prefer increase readability with a larger indentation.

Robin Vowels

unread,
Jul 6, 2022, 6:35:41 AMJul 6
to
On Wednesday, April 20, 2022 at 5:30:42 AM UTC+10, Jeffrey R.Carter wrote:
> On 2022-04-18 23:58, Thomas wrote:
> >
> > how do you set your max line length?
> I use the Preferences menu selection in my editor. But that's probably not what
> you intended to ask. I set mine to 132 characters.
> > using indentations a lot, i find that 80 is short.
> > but I don't realize how many people I'm going to disturb if I set a
> > greater length, because I don't know all your uses.
.
> When I started out, source lines were limited to 80 columns because that was the
> length of punched cards,
.
What luxury! All the languages on our computer used only 32 columns of the card.
.
> but the line printers could print 132 columns.
.
120 and 132 columns were common.
Our Analex 1100 lines/min printer had 160 columns, so it was possible to print a source listing
(80/80 listing) with two sets per page.
Reply all
Reply to author
Forward
0 new messages