Path: utzoo!utgpu!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!cwjcc!hal!nic.MR.NET!tank!mimsy!dftsrv!ames!amdcad!sun!quintus!ok
From: ok@quintus.uucp (Richard A. O'Keefe)
Newsgroups: comp.unix.wizards
Subject: Re: Indenting and alignment style
Keywords: braces religion
Message-ID: <823@quintus.UUCP>
Date: 7 Dec 88 21:58:06 GMT
References: <17680@adm.BRL.MIL> <1748@solo3.cs.vu.nl> <9063@smoke.BRL.MIL> <9076@smoke.BRL.MIL> <4733@mtgzz.att.com>
Sender: news@quintus.UUCP
Reply-To: ok@quintus.UUCP (Richard A. O'Keefe)
Organization: Quintus Computer Systems, Inc.
Lines: 30
In article <4733@mtgzz.att.com> avr@mtgzz.att.com (a.v.reed) writes:
> Objective readability (on which there
>is a vast literature in psychology, human factors and education
>journals) suggests that the optimal style would provide the reader with
>vertical alignment of the closing brace with the opening brace, and of
>immediately enclosed text with the enclosed braces, like this:
>
> function(argument,argument)
> {
> statement;
> statement;
> }
>
Please cite a study which shows this.
In a language which uses keywords 'start' 'finish' instead of braces,
this is demonstrably silly:
start
if x > y ...
while ...
finish
lines the brackets up with the keywords of statements that have nothing
to do with them. Surely it is clear that to avoid this kind of visual
confusion, the brackets must be elsewhere
...
...
The "comb" style as recommended for ADA works well in nearly every
language.