On 19/12/2020 22:36, James K. Lowden wrote:
On Sat, 19 Dec 2020 20:18:19 +0000
Karthik Suresh <k.sur...@jayamony.co.uk> wrote:
I think it's also the advice Brian Kernighan gives about breaking
at natural phrase points in the text as we tend to edit a phrase at a
time.
I hadn't heard that. Do you know where you read it?
Going back to 1983 is the Unix Documenter’s Workbench that has these
lines about typing a document:
“First, when you do the purely mechanical operation of typing, type so
that later editing will be easy. Start each sentence on a new line. Make
lines short, and break lines at natural places, such as after commas and
semicolons, rather than randomly. Since most people change documents by
rewriting phrases and adding, deleting, and rearranging sentences, these
precautions simplify any editing needed later.”
This approach is also particularly useful if you use ed a lot, which I
do for writing as it makes editing in a line editor so much easier. For
example, Kernighan's tutorial to ed uses the following example:
Now is the time
for all good men
to come to the aid of their party.
The article I mentioned in the previous thread, about "semantic
linefeeds" is the bit that ties this to Kernighan. Extract below.
https://rhodesmill.org/brandon/2012/one-sentence-per-line/
But after an extensive search, I have found an earlier source — and I
could not be any happier to discover that my inspiration is none other
than Brian W. Kernighan!
He published “UNIX for Beginners” [PDF] as Bell Labs Technical
Memorandum 74-1273-18 on 29 October 1974. It describes a far more
primitive version of the operating system than his more famous and more
widely available “UNIX for Beginners — Second Edition” from 1978. After
a long search I have found the lone copy linked above, hosted on an
obscure Japanese web page about UNIX 6th Edition which has now
disappeared but can still be viewed on the Internet Archive’s Wayback
Machine (to which both of the links above point). In the section “Hints
for Preparing Documents,” Kernighan shares this wisdom:
Hints for Preparing Documents
Most documents go through several versions (always more than you
expected) before they are finally finished. Accordingly, you should do
whatever possible to make the job of changing them easy.
First, when you do the purely mechanical operations of typing, type
so subsequent editing will be easy. Start each sentence on a new line.
Make lines short, and break lines at natural places, such as after
commas and semicolons, rather than randomly. Since most people change
documents by rewriting phrases and adding, deleting and rearranging
sentences, these precautions simplify any editing you have to do later.
— Brian W. Kernighan, 1974
Karthik