comp.lang.ada
 help / color / mirror / Atom feed
From: Niklas Holsti <niklas.holsti@tidorum.invalid>
Subject: Re: Ada standard and maximum line lengths
Date: Thu, 31 Jan 2013 11:30:27 +0200
Date: 2013-01-31T11:30:27+02:00	[thread overview]
Message-ID: <amurtjF1babU1@mid.individual.net> (raw)
In-Reply-To: <alpine.DEB.2.02.1301310939580.17341@debian>

On 13-01-31 11:10 , Stefan.Lucks@uni-weimar.de wrote:

> In any case, nobody should need line lengths of more than about 200
> characters. This is not a technological limit, this is related to human
> vision. The typical line length (about 80 characters) has been chosen to
> be well-readable by humans. (Actually, most people consider this a bit
> too large ... but let us stick with "about 80" for the sake of the
> argument.)

 [snip]

> The only reason to support longer lines would be to handle automatically
> generated code, that is *not* meant to be human-readable. In fact,
> writing tools to generate source code is (slightly) easier if one does
> not need to care about line ends at all, writing a source file into a
> single line ...

"Slightly" is right. It is very simple to make the source-code generator
insert newlines between lexical elements to keep lines from growing
unreasonably long.

In practice, when one is developing a program that generates source-code
(in Ada or other languages), it is often necessary to look at the output
to check that it is correct, or to understand why it is wrong, and this
is much easier if the output is not only broken into lines, but also
indented in the usual way.

A pretty-printer post-processor could be used to format single-long-line
output, but this raises the questions of how long input lines the
pretty-printer can handle, and whether it can handle syntactically or
lexically illegal or incomplete input. Also, if the source-code
generator itself does the indenting, incorrect indentation can be a good
clue for finding errors in the generator, in my experience.

So, developing a working automatic source-code generator is easier if
the generator produces code that is nicely broken into lines and nicely
indented. Generating a single long line is not the best way, unless the
output must be as short as possible (avoiding consecutive spaces or tabs
for indentation).

-- 
Niklas Holsti
Tidorum Ltd
niklas holsti tidorum fi
      .      @       .



  reply	other threads:[~2013-01-31  9:30 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-28  5:02 Ada standard and maximum line lengths Lucretia
2013-01-28  6:01 ` J-P. Rosen
2013-01-28  6:28 ` Jeffrey Carter
2013-01-28  8:05   ` Niklas Holsti
2013-01-28 16:42     ` Jeffrey Carter
2013-01-28 20:22       ` Niklas Holsti
2013-01-28 20:46         ` J-P. Rosen
2013-01-28 21:29           ` Niklas Holsti
2013-01-29  1:42             ` Randy Brukardt
2013-01-29  6:15             ` J-P. Rosen
2013-01-29 10:25               ` Niklas Holsti
2013-01-29 11:31                 ` Georg Bauhaus
2013-01-29 12:11                   ` Simon Wright
2013-01-29 12:31                   ` Niklas Holsti
2013-01-29 12:37                     ` Niklas Holsti
2013-01-29 15:29                     ` Georg Bauhaus
2013-01-29 16:58                       ` Niklas Holsti
2013-01-29 17:51                         ` Georg Bauhaus
2013-01-29 18:18                           ` Shark8
2013-01-29 19:54                           ` Niklas Holsti
2013-01-29 23:12                             ` Georg Bauhaus
2013-01-30  9:18                               ` Niklas Holsti
2013-01-30  9:51                                 ` Simon Wright
2013-01-30 15:28                                 ` Robert A Duff
2013-01-30 23:24                                   ` Randy Brukardt
2013-01-31  2:16                                     ` Robert A Duff
2013-01-31  9:10                                       ` Stefan.Lucks
2013-01-31  9:30                                         ` Niklas Holsti [this message]
2013-01-31  9:51                                           ` Simon Wright
2013-01-31 10:56                                           ` Georg Bauhaus
2013-01-31 18:02                                         ` Jeffrey Carter
2013-01-31 23:54                                       ` Randy Brukardt
2013-02-01  9:15                                         ` Niklas Holsti
2013-02-01 23:13                                           ` Randy Brukardt
2013-02-02  1:24                                             ` Lucretia
2013-02-02 14:12                                               ` Robert A Duff
2013-02-05  2:09                                               ` Randy Brukardt
2013-01-31  9:03                                   ` Dmitry A. Kazakov
2013-01-30  9:37                               ` Simon Wright
2013-01-30 12:02                                 ` Georg Bauhaus
2013-01-29 23:47                             ` Jeffrey Carter
2013-01-30  7:24                               ` Niklas Holsti
2013-01-30 10:09                                 ` J-P. Rosen
2013-01-29 20:36                 ` Niklas Holsti
2013-01-29 21:01                   ` Robert A Duff
2013-01-29 21:14                   ` Dmitry A. Kazakov
2013-01-28  8:18 ` Dmitry A. Kazakov
2013-01-28 10:02   ` Maciej Sobczak
2013-01-28 11:57     ` Georg Bauhaus
2013-01-28 13:28       ` Niklas Holsti
2013-01-28 15:14       ` J-P. Rosen
2013-01-28 16:13       ` Dmitry A. Kazakov
2013-01-28 15:13     ` Dmitry A. Kazakov
2013-01-28 13:49 ` Robert A Duff
2013-01-29  2:09   ` Randy Brukardt
2013-01-29 18:46 ` Lucretia
2013-01-29 20:53   ` Robert A Duff
2013-01-29 21:22   ` Dmitry A. Kazakov
2013-01-30  3:22     ` Lucretia
2013-01-30  9:49       ` Dmitry A. Kazakov
2013-01-30 23:28         ` Randy Brukardt
2013-02-01  1:48       ` Shark8
2013-01-29 21:29   ` Dmitry A. Kazakov
2013-01-29 21:53   ` Adam Beneschan
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox