List members may be interested in this new article published today:
Steven M. Bellovin
Netnews: The Origin Story
IEEE Annals of the History of Computing 47(1) 7--21 Jan/Mar 2025
https://doi.org/10.1109/MAHC.2024.3420896
-------------------------------------------------------------------------------
- Nelson H. F. Beebe Tel: +1 801 581 5254 -
- University of Utah -
- Department of Mathematics, 110 LCB Internet e-mail: beebe(a)math.utah.edu -
- 155 S 1400 E RM 233 beebe(a)acm.org beebe(a)computer.org -
- Salt Lake City, UT 84112-0090, USA URL: https://www.math.utah.edu/~beebe -
-------------------------------------------------------------------------------
Beating a nearly dead horse, I'm shipping this to COFF instead of TUHS
to which it responds.
> I find
>
> if (a == b && c == d)
>
> perfectly reasonable, but
>
> if ((a == b) && (c == d))
>
> to be just silly.
Amusing. IT's odd that no one has mentioned the use of spaces for
grouping. When the operands of == are simple, I prefer to vary the
spacingy spacing. It's less intrusive than extra parentheses and just
as clear.
if(a==b && c==d) or
if( a==b && c==d )
K&R usually flank every infix operator with spaces, unlike classical
mathematical usage, where spacing reflects operator precedence. I
usually write a*b + c*d, not a * b + c * d, which wantonly flattens
the parse tree. Here's an example from K&R, where uniform spacing
hampers intelligibility.
for (i = 0; s[i] >= '0' && s[i] <= '9'; ++i)
n = 10 * n + (s[i] - '0');
The "extra" parens in the second line admirably show the intent of the
subtraction. Other groupings are not so well indicated. I would write
it like this:
for(i=0; s[i]>='0' && s[i]<='9'; ++i)
n = 10*n + (s[i]-'0');
(I'll admit that the juxtaposition ]>= is less than perspicuous.)
Long identifiers constitute a level of grouping that takes precedence
even over multiplication. So I may flank long identifiers with spaces.
I suppose then + in a sum of products might deserve double spaces.
That's probably a bridge too far, but double spaces after the
semicolons in the "for" statement above seem justifiable
K&R aren't absolutely rigid about spacing. In the following oddly
mixed specimen, the first of three operands in a conjunction is spaced
tightly, but the third is not; I guess they feel about != the way I do
about long identifiers.
i<lim-1 && (c = getchar()) != '\n' && c != EOF
The middle conjunct is a challenge. I'd probably squeeze out the
spaces. But I might instead try to hold it together with outer parens.
Doug
Mention of punched cards reminded me of some 1960s trivia.
There were two formats for binary code on punched cards for IBM 700-series
machines. In "row binary" two 36-bit words filled each of the 12 rows from
bottom to top. In "column binary" successive thirds of a word ran downward
in each of 3 successive columns. Bob Morris wondered what is the order of
the permutation performed in row-to-column conversion.
The order of the row-to-column permutation turns out to be 172. There are
five cycles of that length plus an oddball of length 4. My souvenir card
shows the oddball.
If you convert a cycle from row binary to column binary, the output is the
same as the input.* Each cycle is also invariant under 180-degree
rotation.The 4-cycle is a simple parallelogram. One of the 5-cycles lines
up in periodic diagonals. The other cycles show no easily described
structure.
The images of the two described cycles should be viewed in a fixed-width
font. The punches in the 4-cycle are numbered in cyclic order.
I keep a few souvenir punched cards. One bears that 4-cycle.
* Well, almost the same. The first word on the card contains control
information whose layout differs in the two formats.
Doug
........................................................................
........................................................................
...........................................3............................
........................................................................
..............2.........................................................
........................................................................
........................................................................
.........................................................4..............
........................................................................
............................1...........................................
........................................................................
........................................................................
..X....X....X....X....X....X....X....X....X....X....X....X....X....X....
....X....X....X....X....X....X....X....X....X....X....X....X....X....X..
.X....X....X....X....X....X....X....X....X....X....X....X....X....X....X
...X....X....X....X....X....X....X....X....X....X....X....X....X....X...
X....X....X....X....X....X....X....X....X....X....X....X....X....X....X.
..X....X....X....X....X....X....X....X....X....X....X....X....X....X....
....X....X....X....X....X....X....X....X....X....X....X....X....X....X..
.X....X....X....X....X....X....X....X....X....X....X....X....X....X....X
...X....X....X....X....X....X....X....X....X....X....X....X....X....X...
X....X....X....X....X....X....X....X....X....X....X....X....X....X....X.
..X....X....X....X....X....X....X....X....X....X....X....X....X....X....
....X....X....X....X....X....X....X....X....X....X....X....X....X....X..
https://boingboing.net/2025/03/10/make-your-own-virtual-punchcard.html
[50 years ago today I started working at IBM Yorktown. My boxes of
punchcards from graduate work at UT-Austin were enroute with the movers
from Austin, to be fed into VM-370 after they arrived. I wish I had kept
those boxes as souvenirs.]
Charlie
--
voice: +1.512.784.7526 e-mail: sauer(a)technologists.com
fax: +1.512.346.5240 Web: https://technologists.com/sauer/
Facebook/Google/LinkedIn/mas.to: CharlesHSauer