On Sat, Aug 04, 2007 at 04:56:30PM +0200, Nikodemus Siivola wrote:
> Our current convention (that we're not quite perfect about) is 80.
> How would people feel about extending it a bit? I think often enough
> the code is easier to read when line-length allowed to grow.
> Especially splitting function calls with a moderate number of arguments
> (when the call is the only thing on the line) across multiple lines
> doesn't enhance readability for me at all -- quite the contrary.
> While occasionally long lines are bothersome, making it harder to look
> at two pieces of code side-by-side, I'm not sure this case is the one
> we want to optimize for -- not at the cost of making the same bits harder
> to read when looked at in isolation.
> ...but never worry, I'm not going to start using long lines unless there
> is some sort of agreement on the issue.
I don't feel passionately about it, but for me 80 lines is generally
wide enough: the advantage of often viewing multiple panes side by
side competes quite effectively with the advantage of sometimes
expressing more complicated things in a single line. If I were to
change standard width, I think I'd actually be more inclined to shrink
it a little (to 72ish, perhaps, as I have sometimes done on one of two
panes on a laptop) than to increase it. But 80 has the additional
advantage that it's the de facto standard, so usually only physical
difficulty of packing readable fonts into squashed spaces motivates me
to use a different width.
I don't only view pieces of code side by side: I tend to use other
panes for things like documentation (sometimes text in emacs,
sometimes something fancier in a browser or xdvi or something), an
inferior lisp buffer, a *grep* buffer, or scratch.
> PS. As a discussion piece, here's a bit of code I'm working on
> wrapped to IMO "naturally" -- largest column 98:
> (defun flush-output-buffer (stream)
> (let ((obuf (fd-stream-obuf stream)))
> (when obuf
> (let ((head (buffer-head obuf))
> (tail (buffer-tail obuf)))
IIRC the Scheme DEFINE syntactic sugar flattens indentation like that.
(Certainly C++ declaration-with-initialization of variables flattens
indentation like that, maybe I'm confusing Scheme with C++...) I
wonder why the Lisps on the CL branch of the taxonomy didn't do such a
thing. Too busy specifying pathnames, perhaps.
William Harold Newman <william.newman@...>
PGP key fingerprint 85 CE 1C BA 79 8D 51 8C B9 25 FB EE E0 C3 E5 7C
Ubi saeva indignatio ulterius cor lacerare nequit. -- Jonathan Swift's epitaph