Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!ucsd!pacbell.com!pacbell!osc!jgk From: jgk@osc.COM (Joe Keane) Newsgroups: comp.lang.functional Subject: Re: concrete syntax (was: "off-side rule") Summary: Whitespace shouldn't be significant. Keywords: whitespace Message-ID: <4167@osc.COM> Date: 23 Jan 91 19:55:15 GMT References: <4842@skye.cs.ed.ac.uk> Reply-To: jgk@osc.COM (Joe Keane) Distribution: comp Organization: Versant Object Technology, Menlo Park, CA Lines: 34 I think the people arguing for significant use of whitespace have good intentions, but they're a little misguided. Basically i think they're solving a problem that doesn't exist. In C the syntax of statements and blocks is so simple, i can state it in less than a line: a statement ends with `;', and `{' and `}' delimit blocks. I've been using C for a long time and i have a number of gripes about the language, but this is not one of them. The syntax is simple and easy to use. Because of the simple syntax, editing C code is easy. You can cut and paste arbitrary blocks, without having to adjust the indentation if you don't feel like it. A neat property is that you can hit M-q (fill-paragraph) in Emacs, and the code may become very hard to read but it still works fine. In English the rule is simple: sentences end in `.' and questions end in `?'. You could propose a scheme where periods are optional at the end of a line, and add some way to indicate that a sentence continues to the next line. But if someone did this, people would laugh at him. Why fix what isn't broken? Also there is the issue of readability. Some people claim that the form without a semicolon `looks better'. This is clearly a matter of taste, and it probably depends on whether you're used to reading pseudo-code or C code. I actually like the other form better. If you use a normal indenting style, it's true that the semicolon is redundant, but a little redundancy can make it easier to read. In FLs we have a number of schemes which make use of whitespace. But what do you gain from this? What it comes down to is that you can avoid typing a semicolon or braces in some cases. But these schemes are more complicated than those they replace. Some languages say that you can use a semicolon to separate statements, but that it's optional in certain cases depending on surrounding whitespace. By the time you have rules like this, the elegance has been lost, and you have to wonder if it wouldn't be easier to just always put the semicolon.