[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 0/2] Add tools for sysadmins: htop and dfc.
From: |
Nikita Karetnikov |
Subject: |
Re: [PATCH 0/2] Add tools for sysadmins: htop and dfc. |
Date: |
Sat, 31 Aug 2013 01:52:39 +0400 |
> Yes. I never know what to do in such cases. Is there a document that
> contains these coding-style rules, such as the PEP8 for Python ?
The pretty-printing rule is described in SICP. Search for “There is no
limit” [1]. However, that paragraph doesn’t say what to do when the
line is too long.
I’m trying to keep lines under 79 characters (as suggested in PEP8). It
allows “to have several files open side-by-side, and works well when
using code review tools that present the two versions in adjacent
columns” [2]. I also find that short lines are easier to read.
I believe it’s OK to write
(proc very-very-very-very-very-very-long-argument
a b c)
instead of
(proc very-very-very-very-very-very-long-argument
a
b
c)
because this allows to display more lines on the screen.
Also, it may be a good idea to write
(very-long-procedure1
argument1
(very-long-procedure2
argument2
(very-long-procedure3
argument3
(...))))
instead of
(very-long-procedure1 argument1
(very-long-procedure2 argument2
(very-long-procedure3 argument3
(...))))
That said, you have to break the rules sometimes.
Should we mention this in the “packaging rules” section?
[1] https://mitpress.mit.edu/sicp/full-text/book/book-Z-H-10.html#%_sec_1.1.1
[2] http://www.python.org/dev/peps/pep-0008/#maximum-line-length
pgp3O9uRfhYEP.pgp
Description: PGP signature
[PATCH 1/2 v2] gnu: Add htop., Cyril Roelandt, 2013/08/30
Re: [PATCH 0/2] Add tools for sysadmins: htop and dfc., Andreas Enge, 2013/08/30
Re: [PATCH 0/2] Add tools for sysadmins: htop and dfc., Ludovic Courtès, 2013/08/31