Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!cs.utexas.edu!samsung!crackers!jjmhome!smds!rh From: rh@smds.UUCP (Richard Harter) Newsgroups: comp.lang.functional Subject: Re: "off-side rule" Summary: Au Contraire Message-ID: <302@smds.UUCP> Date: 19 Jan 91 09:41:46 GMT References: Distribution: comp Organization: SMDS Inc., Concord, MA Lines: 47 In article , spot@CS.CMU.EDU (Scott Draves) writes: > While it's true that one can use indentation to replace grouping, i > think this is quite dangerous. Many programs feel free to change the > spacing in a program. emacs will often convert between tabs and > spaces. some implementations of cpp converts tabs to spaces. One has to distinguish between the off-side rule and the use of indentation for grouping. The off-side rule is, from what I can see, a potential source of petty little disasters. On the other hand, using identation as the delimiter for grouping is IMHO *the right thing to do* in block structured languages. The standard practice of using begin/end delimiters, coupled with using indentation (standard programming practice) violates the single control point principle. It is a regular source of annoying little bugs, the "dangling else" being the most notorious example. The argument that many programs change spacing is not to the point; programs that change source code text in an unspecified language using arbitrary assumptions are, to put it mildly, not of professional quality. > i don't think the fact that it can be turned off helps, one could > still receive someone else's code that uses it, and then you're hosed. This is actually a good point. Language features which can be "turned on or off, according to one's taste are bad features. One of the most notorious abuses of cpp is to use macros to make C to look like some other language. > it's just plain gross. May I suggest in turn that the Algol tradition of treating programs as streams of text to be processed by machines, rather than as text to be read and written by programmers is a fundamental conceptual error. It is my impression that a reaction such "it's just plain gross" is just another variant of "This is the way I learned to do it, so it must be the only way to do it." No doubt this is unfair on my part, so accept my apologies in advance. However, having worked with languages that used begin/end and cousins and with languages that used indentation for block structure, I can say I find the latter much more natural, once one overcomes one's initial habits. -- Richard Harter, Software Maintenance and Development Systems, Inc. Net address: jjmhome!smds!rh Phone: 508-369-7398 US Mail: SMDS Inc., PO Box 555, Concord MA 01742 This sentence no verb. This sentence short. This signature done.