Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!cbatt!ihnp4!drutx!druil!lat From: lat@druil.UUCP (TepperL) Newsgroups: net.lang Subject: Re: More (ad nauseum) on removing punctuation in programming languages Message-ID: <201@druil.UUCP> Date: Mon, 27-Oct-86 14:26:47 EST Article-I.D.: druil.201 Posted: Mon Oct 27 14:26:47 1986 Date-Received: Tue, 28-Oct-86 02:23:36 EST References: <21836@rochester.ARPA> <2642@hammer.TEK.COM> <694@looking.UUCP> Organization: AT&T Information Systems Labs, Denver, Co Lines: 59 Summary: Perhaps we just need different punctuation In article <694@looking.UUCP>, brad@looking.UUCP writes: > In article <2642@hammer.TEK.COM> andrew@hammer.UUCP writes: > >If you think it's easy to misplace a curly brace, you ain't seen > >nothing until you go looking for the subtle program misbehavior caused > >by incorrect indentation! > > True, and very important. Indentation is guaranteed to balance out by the > end of the program. There's no such thing as an error, as far as the compiler > can detect (except in a few cases where extra keywords like else appear). I think that the issue isn't so much removing all punctuation, but merely making a judicious choice in what is required and what is optional. In the vast majority of C code I've ever seen, there is usually just one statement per line. I've looked at a lot of the UNIX source code. That means to me that in a new C-like language, one could: 1) Add new-line as a statement terminator 2) Let semi-colon stand as a statement terminator, but drop the for it. Semi-colon would then be used for multi-statement lines. I guess that makes it a statement separator. 3) Add something like to indicate a statement continued across line boundaries. I've been bitten by the bad-indentation bug myself. Problems like that are tough to find. The typical way that it happens to me goes something like this: Write a while loop with a one-statement body: while (condition) do something; The program is working right, so I add some debug: while (condition) fprintf(stderr, "Hi, I got to the loop, n = %d\n"m ); do something; You get the idea. I've introduced another bug with my debug code. What I've found out recently is that a lot of times when I write single statement loops without curly braces, it turns out that sooner or later I have to add them anyway as the loop grows. Here's what I propose for a new C-like language: 1) Require curly braces in all loops. 2) Drop the requirement for parentheses in the condition statement. This means you wouldn't have to do any more typing than before, and the language would prevent you from getting bitten by the incorrect-indentation bug. -- Larry Tepper {ihnp4 | allegra}!drutx!druil!lat +1-303-538-1759