The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
* [TUHS] Comments in early Unix systems
@ 2018-03-22 13:49 Doug McIlroy
  2018-03-22 14:29 ` Nemo
  2018-03-22 16:30 ` [TUHS] Literate Programming (was Comments in early Unix systems) arnold
  0 siblings, 2 replies; 29+ messages in thread
From: Doug McIlroy @ 2018-03-22 13:49 UTC (permalink / raw)


"I was told in school (in 1985) that if I was ever lucky enough to
have access to the unix source, I'd find there were no comments. The
reason, I was told at the time, was that comments would make the
source code useful, and selling software was something AT&T couldn't
do due to some consent decree."

I can't speak for SYS V, but no such idea was ever mentioned in
Research circles. Aside from copyright notices, the licensing folks
took no interest in comments. Within rsearch there was tacit
recognition of good coding style--Ken's cut-to-the-bone code was
universally admired. This cultural understanding did not extend
to comments. There was disparagement for the bad, but not honor
for the good. Whatever comments you find in the code were put
there at the author's whim.

My own commenting style is consistent within a project, but
wildly inconsistent across projects, and not well correlated
with my perception of the audience I might be writing for.
Why? I'm still groping for the answer.

For imoortant code, custom is to describe it in a separate
paper, which is of course not maintained in parallel with
the code. In fact, comments are often out of date, too.
Knuth offered the remedy of "literate programming", which
might help in academic circles. In business, probably not.
Yet think of the possibility of a "literate spec", where
the code grows organically with the understanding of what
has to be done.

Doug


^ permalink raw reply	[flat|nested] 29+ messages in thread
* [TUHS] Comments in early Unix systems
@ 2018-03-23  1:54 Doug McIlroy
  0 siblings, 0 replies; 29+ messages in thread
From: Doug McIlroy @ 2018-03-23  1:54 UTC (permalink / raw)


Thanks for the noweb story. A reward for straying off topic!

Doug


^ permalink raw reply	[flat|nested] 29+ messages in thread
* [TUHS] Comments in early Unix systems
@ 2018-03-22  1:40 Noel Chiappa
  2018-03-22  2:19 ` Steve Nickolas
  0 siblings, 1 reply; 29+ messages in thread
From: Noel Chiappa @ 2018-03-22  1:40 UTC (permalink / raw)


    > From: Warren Toomey <wkt at tuhs.org>

    > there is next to no commenting in the early code bases.

By 'early' you must mean the first 'C' PDP-11 Unixes, because certainly
starting with V6, it is reasonably well commented (to the point where I like
to say that I learned how to comment by reading the V6 code), e.g.:

  http://minnie.tuhs.org/cgi-bin/utree.pl?file=V6/usr/sys/ken/slp.c
  http://minnie.tuhs.org/cgi-bin/utree.pl?file=V6/usr/sys/dmr/bio.c

to pick examples from each author; and there are _some_ comments in the
assembler systems (both PDP-7 and PDP-11).

    > Given that the comments never made it into the compiled code, there was
    > no space reason to omit comments. There must have been another reason.

I was going to say 'the early disks were really small', but that hypothesis
fails because the very earliest versions (in assembler) do have some comments.

Although assembler is often so cryptic, the habit of putting a comment on each
instruction isn't so unreasonable.

So maybe the sort of comments one sees in assembler code (line-by-line
descriptions of what's happening; for subroutines, which arguments are in
which registers; etc) aren't needed in C code, and it took a while for them to
work out what sort of commenting _was_ appropriate/useful for C code?

The sudden appearance in V6 does make it seem as if there was a deliberate
decision to comment the code, and they went through it and added them in a
deliberate campaign.


    > From: Andy Kosela <akosela at andykosela.com>

    > "Practice of Programming" by Rob Pike and Brian Kernighan.
    > ...
    > They also state: "Comments ... do not help by saying things the code
    > already plainly says ... The best comments aid ... by briefly pointing
    > out salient details or by providing a larger-scale view of the
    > proceedings."

Exactly.

     Noel


^ permalink raw reply	[flat|nested] 29+ messages in thread
* [TUHS] daemons are not to be exorcised
@ 2018-03-21 14:17 Noel Chiappa
  2018-03-21 15:03 ` Clem Cole
  0 siblings, 1 reply; 29+ messages in thread
From: Noel Chiappa @ 2018-03-21 14:17 UTC (permalink / raw)


    > From: Larry McVoy <lm at mcvoy.com>

    > Going forward, I wish that people tried to be simple as they tackle the
    > more complicated problems we have.

I have a couple of relevant quotations on my 'Some Computer-Related Lines'
page:

  "Deliberate complexity is the mark of an amateur. Elegant simplicity is the
  mark of a master."
	-- Unknown, quoted by Robert A. Crawford 

  "Fools ignore complexity. Pragmatists suffer it. Some can avoid it. Geniuses
  remove it."
	-- Alan Perlis

  "The most reliable components are the ones you leave out." 
	-- Gordon Bell

(For software, the latter needs to be read as 'The most bug-free lines of
codqe are the ones you leave out', of course.)


I remember watching the people building the LISP machine, and thinking 'Wow,
that system is complex'. I eventually decided the problem was that they were
_too_ smart. They could understand, and retain in their minds, all that
complexity.

	Noel


^ permalink raw reply	[flat|nested] 29+ messages in thread

end of thread, other threads:[~2018-03-23  1:54 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-22 13:49 [TUHS] Comments in early Unix systems Doug McIlroy
2018-03-22 14:29 ` Nemo
2018-03-22 16:30 ` [TUHS] Literate Programming (was Comments in early Unix systems) arnold
2018-03-22 16:48   ` Jon Steinhart
2018-03-22 17:07   ` Toby Thain
  -- strict thread matches above, loose matches on Subject: below --
2018-03-23  1:54 [TUHS] Comments in early Unix systems Doug McIlroy
2018-03-22  1:40 Noel Chiappa
2018-03-22  2:19 ` Steve Nickolas
2018-03-21 14:17 [TUHS] daemons are not to be exorcised Noel Chiappa
2018-03-21 15:03 ` Clem Cole
2018-03-21 16:18   ` Arthur Krewat
2018-03-21 17:28     ` Paul Winalski
2018-03-21 18:04       ` Dan Cross
2018-03-21 19:56         ` Clem Cole
2018-03-21 20:13           ` Paul Winalski
2018-03-21 20:28             ` [TUHS] Comments in early Unix systems Warren Toomey
2018-03-21 20:48               ` Ron Natalie
2018-03-21 22:18               ` William Corcoran
2018-03-21 23:02                 ` Clem Cole
2018-03-22  1:31                   ` Larry McVoy
2018-03-21 23:17                 ` Arthur Krewat
2018-03-21 23:50                   ` Larry McVoy
2018-03-22  0:55                     ` Mike Markowski
2018-03-22  1:00                       ` Larry McVoy
2018-03-21 23:45               ` Warner Losh
2018-03-22  0:31                 ` Steve Johnson
2018-03-22  0:58               ` Andy Kosela
2018-03-22  1:27                 ` Larry McVoy
2018-03-22  1:59                   ` Bakul Shah
2018-03-22 14:46                   ` Steve Simon
2018-03-22 15:22                     ` ron minnich
2018-03-22 16:22                     ` Ron Natalie
2018-03-22 16:32                       ` arnold
2018-03-22 20:20                         ` Lyndon Nerenberg
2018-03-22 16:33                       ` Kurt H Maier
2018-03-23  1:31                   ` Charles Anthony

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).