unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Robert J. Chassell" <bob@rattlesnake.com>
Subject: Re: Source code formatting: line length limit?
Date: Sun, 26 Jan 2003 13:12:52 +0000 (UTC)	[thread overview]
Message-ID: <m18cmai-000IeGC@localhost> (raw)
In-Reply-To: <200301260121.h0Q1LXx18015@rum.cs.yale.edu> (monnier+gnu/emacs@rum.cs.yale.edu)

I wrote:

   > ....  A fill-column of 70 works well with the usual
   > between-line spacing on a computer screen.

"Stefan Monnier" <monnier+gnu/emacs@rum.cs.yale.edu> responds

   Note that in source code, most lines don't start in column 0, so for
   a given line, the number of columns of text is not necessarily the same
   as the column of the rightmost char.

   I happen to think that 60 columns is more legible,  ...

Yes.  In some ways, 60 is better; it is even harder to swing your eyes
down when the lines do not start in the left most column.

However, one advantage of a wider line is that more information is put
on the line.  Programming expressions are ways of stating complex
notions in a manner than a human can comprehend.  It is easier to
understand and bear in mind a notion laid out in one line than spread
out over two or three.  A key characteristic of programming languages
designed for programmers, such as C or Lisp, is that they are
succinct.

On the other hand, excessive width does reduce the compactness of a
notation as much as excessive depth, so a line cannot be overly long.

(Excessive succinctness creates another problem; many programmers find
it hard to comprehend a expression that is `too concise', for some
fuzzy definition of `too concise'.  A popular programming language
must be a balance between `too concise' and `too wordy'.)

   .... but I also think that in most cases, source code that spans 80
   columns is perfectly legible because almost none of the lines
   actually takes more than 60 columns of text.
   ... 
   Also the non-constant indentation of the code also helps
   your eyes find the next line.

Indentation helps, but large areas of blank space on the left give
difficulty to me nonetheless.

   And since I find vertical screen-real-estate to be at a premium, I advocate
   using all 80 columns for code (text is obviously another matter).

An 80 column text looks terrible when patched or quoted so as to be
wider, but still shown on an 80 column window.  Consequently, an 80
column width will discourage some from quoting or patching your code,
since he or she will have to pretty print it before working on it.

-- 
    Robert J. Chassell                         Rattlesnake Enterprises
    http://www.rattlesnake.com                  GnuPG Key ID: 004B4AC8
    http://www.teak.cc                                     bob@gnu.org

  reply	other threads:[~2003-01-26 13:12 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-25 12:39 Source code formatting: line length limit? Kai Großjohann
2003-01-25 13:26 ` Robert J. Chassell
2003-01-26  1:21   ` Stefan Monnier
2003-01-26 13:12     ` Robert J. Chassell [this message]
2003-01-27  2:32       ` Richard Stallman
2003-01-27 14:14       ` Stefan Monnier
2003-01-26 14:48     ` Kai Großjohann
2003-01-26 18:49       ` Robert J. Chassell
2003-01-27  2:32       ` Richard Stallman
2003-01-27 13:01       ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m18cmai-000IeGC@localhost \
    --to=bob@rattlesnake.com \
    --cc=bob@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).