Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!columbia!rutgers!sri-spam!sri-unix!hplabs!tektronix!uw-beaver!ubc-vision!alberta!cdshaw From: cdshaw@alberta.UUCP Newsgroups: net.lang Subject: Re: More (ad nauseum) on removing punctuation in programming languages Message-ID: <108@pembina.alberta.UUCP> Date: Mon, 3-Nov-86 15:37:40 EST Article-I.D.: pembina.108 Posted: Mon Nov 3 15:37:40 1986 Date-Received: Fri, 7-Nov-86 08:48:12 EST References: <21836@rochester.ARPA> <2642@hammer.TEK.COM> <694@looking.UUCP> <7125@boring.mcvax.UUCP> Reply-To: cdshaw@pembina.UUCP (Chris Shaw) Organization: U. of Alberta, Edmonton, AB Lines: 62 In article <7125@boring.mcvax.UUCP> guido@boring.uucp (Guido van Rossum) writes: >The difference between misplaced braces bugs and misplaced indentation >bugs is that misplaced (often: missing) braces are hard to find. No they aren't. Use an editor which finds matching braces. They are common and very reliable. >On the other hand, misplaced indentation is immediately spotted by the >human reader, e.g. (using a language I am familiar with as example): > > PUT "" IN name > GET.CHAR c > WHILE 'a' <= c <= 'z': begin > WRITE c > PUT name^c IN name end > GET.CHAR c \ Bug! should be indented more > >Here, I would say, you notice the bug even while you are typing it, or >if not, you'll catch it immediately when you peruse the program again >after you find it gets stuck in an infinite loop. Thus, I find >indentation sufficient. Sure, but the begin/end pair (in lower case) makes it much more obvious because you have two visual cues. The whole point of indentation is communication with the HUMAN reader. The purpose of begin/end is for the machine. The combination of both is a definite plus. I have great difficulty with indentation-only simply because it is traditional that whitespace is meaningless, and it certainly seems far too easy to innocently delete whitespace and entirely change the program. Swapping begin/end for indentation simply make the compiler less able to catch bugs. Also, what about this: x := 4 ; for( i := 1 to 10 )do { x := 2*i; printf( "This is a debug line\n" ); y := 3 ; } The purpose of left-justifying the printf is so I can see it as garbage and remove it once the program works. My basic point is that indentation rules add the WRONG kind of "stiffness" to programming input. It requires you to be continually counting whitespace. All in all, while I can see the point of making the programmers job easier, it seems foolish to make everything easy simply for the writer's benefit. The point of a program is for others to read as well, so anything which makes the reading job harder is a clear lose. I don't believe that indentation alone is enough to adequately communicate the author's intention. > Guido van Rossum, CWI, Amsterdam Chris Shaw cdshaw@alberta University of Alberta CatchPhrase: Bogus as HELL !