netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "John S. Denker" <jsd@monmouth.com>
To: "David S. Miller" <davem@redhat.com>
Cc: rddunlap@osdl.org, linux-net@vger.kernel.org, netdev@oss.sgi.com,
	David Brownell <david-b@pacbell.net>
Subject: Re: netlink tester program
Date: Mon, 02 Jun 2003 22:33:57 -0400	[thread overview]
Message-ID: <3EDC0915.1080109@monmouth.com> (raw)
In-Reply-To: <20030602.145619.71112623.davem@redhat.com>

On 06/02/2003 05:56 PM, David S. Miller wrote:
 >>
 >> I always have to wonder about someone who can't live with just
 >> working code to study, and absolutely requires some document
 >> describing it.
 >>
 >> What is better or more accurate description than code itself!?!?!

I am very grateful for the kindness of those who
have written the code in question and made it
available to help others.  I wish to repay that
with help and kindness, not the opposite.  Today
I can help by speaking the truth, and the truth
is that documentation is sorely needed.

There's no point in writing code if few people
use it.  Linux is hanging in there at a few
percent market share.  That's not going to grow
unless there is better documentation.


On 06/02/2003 09:56 PM, David Brownell replied:
 >
 > Well, the difference between code and its spec is
 > generally a bug that needs to be fixed ... which
 > can be in the code as well as in the spec.  And for
 > reasonable design specs, it's more likely in the code.
 >
 > But if there's only the code, it gets a lot more
 > troublesome when things don't behave "as expected".
 >
 > People who are in a position to change the code
 > to meet their expectations may not care, but that's
 > rarely a significant chunk of the user community.
 >
 > And in particular, writing tests against the code
 > is generally the wrong way to go.  They need to be
 > written against some kind of spec.

I have to agree with Mr. Brownell on this one.


 >> What is better or more accurate description than code itself!?!?!

There are two ideas mixed up there.
  -- Better documentation.
  -- Accurate description.

1) Yes, code is the most accurate description of the code.
But it is not to be confused with good documentation.

2) Documentation should be clear and concise.
Code must attend to all the details.

3) Sometimes efficiency requires that the code be
tricky.  Documentation must not be tricky.

4) In theory, very well-commented code might
approximate its own documentation.  But I haven't
seen any such code lately.  Here are _all_ the
comments from xfrm_input.c, a 454-line file:

/* Fetch spi and seq frpm ipsec header */
         /* Allocate new secpath or COW existing one. */
/* Fetch spi and seq frpm ipsec header */
                 iph = skb->nh.ipv6h; /* ??? */
                 if (x->props.mode) { /* XXX */
         /* Allocate new secpath or COW existing one. */
#endif /* CONFIG_IPV6 || CONFIG_IPV6_MODULE */


If you were teaching a programming course, how would
you grade an assignment turned in with that level of
commenting?

5) In the engine of a piston-driven airplane, there
are two spark plugs in every cylinder.  Obviously
that costs twice as much and weighs twice as much
as having only one.  But the redundancy makes the
system thousands of times more reliable.

Similarly, writing code _and_ documetation is about
twice as expensive as writing the code alone.  But
the redundancy makes it possible to achieve much
greater reliability.  Also maintainability and
extensibility.

6) Adding extra vehemence '!?!?!' does not add
clarity to the discussion.

*) et cetera.



  parent reply	other threads:[~2003-06-03  2:33 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-30 16:00 netlink tester program Randy.Dunlap
2003-05-31  0:11 ` David S. Miller
2003-05-31  3:22   ` Randy.Dunlap
2003-05-31  6:42     ` David S. Miller
2003-05-31 12:09       ` Andi Kleen
2003-06-02 17:07         ` Randy.Dunlap
2003-06-02 21:04       ` Randy.Dunlap
2003-06-02 21:56         ` David S. Miller
2003-06-03  1:56           ` David Brownell
2003-06-03  2:02             ` David S. Miller
2003-06-03  3:34               ` David Brownell
2003-06-03  3:38                 ` David S. Miller
2003-06-03  3:49                   ` Randy.Dunlap
2003-06-03  3:51                     ` David S. Miller
2003-06-03  7:57                   ` Hisham Kotry
2003-06-09  1:35                     ` Jamal Hadi
2003-06-09 14:37                       ` Mr. James W. Laferriere
2003-06-09 17:16                       ` David S. Miller
2003-06-03  2:33           ` John S. Denker [this message]
2003-06-03  2:38             ` David S. Miller
2003-06-03  3:20               ` John S. Denker
2003-06-03  3:22                 ` David S. Miller
2003-06-03  3:41                   ` John S. Denker
2003-06-03  3:46                     ` David S. Miller
2003-06-03  3:54                       ` Randy.Dunlap
2003-06-03  3:54                         ` David S. Miller
2003-06-03  3:37             ` David Brownell
2003-06-03  3:32           ` Randy.Dunlap
2003-06-03  3:35             ` David S. Miller

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

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

  git send-email \
    --in-reply-to=3EDC0915.1080109@monmouth.com \
    --to=jsd@monmouth.com \
    --cc=davem@redhat.com \
    --cc=david-b@pacbell.net \
    --cc=linux-net@vger.kernel.org \
    --cc=netdev@oss.sgi.com \
    --cc=rddunlap@osdl.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.
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 NNTP newsgroup(s).