From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00,FREEMAIL_FROM, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,997e6472f58cc955 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-06-05 11:31:38 PST Path: archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!border3.nntp.aus1.giganews.com!nntp.giganews.com!nntp3.aus1.giganews.com!nntp.gbronline.com!news.gbronline.com.POSTED!not-for-mail NNTP-Posting-Date: Thu, 05 Jun 2003 13:34:54 -0500 Date: Thu, 05 Jun 2003 13:32:05 -0500 From: Wesley Groleau Reply-To: wesgroleau@despammed.com Organization: Ain't no organization here! User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.3.1) Gecko/20030425 X-Accept-Language: en-us, en, es-mx, pt-br, fr-ca MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Case dependence and coding standards References: <035odv8mfiksmqo69q0250qp141oebtdro@4ax.com> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <5Uudnc0G7djTEEKjXTWcqQ@gbronline.com> NNTP-Posting-Host: 216.117.18.34 X-Trace: sv3-6czlDHXvQabggWBv55CavQ1P7MQIJzwxeihx5nxE0ql1BdCzrmtjj04zNxItzq1VQGBCaOYnkfbbVwX!Ot4KtX/grmX9/otjpNjEKCPxsqWGs9gHuJkzzSeH8Z436xUrLb2xshHKJfbNxxtTRMpkt906NvNS!zGtj X-Complaints-To: abuse@gbronline.com X-DMCA-Complaints-To: abuse@gbronline.com X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.1 Xref: archiver1.google.com comp.lang.ada:38725 Date: 2003-06-05T13:32:05-05:00 List-Id: > Still quickly finding just the modes might be useful in _some_ cases, > but then I'd prefer what is frequently done in print: make > them stand out using bold face type. As you have demonstrated, Yes, that helps, too. > humans can easily find out whether something is tabular in nature > _without_ "squarish" tabular layout, if "abstract" column separators > can easily be seen, like a ':'. But they can do it with less mental energy if it is "squarish" > particulars are important, but how about variable declarations, > consisting of name, type, constraints, and comment? How about > constants, which add another column? Should a constraint that > might have three parts trigger tabular layout? Say you have Indeed, the more parts you have and the longer the names of the parts, the harder it is to keep line length reasonable. I generally consider various options to get the layout that I feel is the least work for an unfamilar person to understand. It is subjective, but I think my intuition is influenced by the empirical studies I've read on readability and human factors, as well as by the numerous misunderstandings I've witnessed people making on poorly formatted code and technical prose, not only in software work, but in teaching math, language, and electronics, and in reading and writing technical material myself. > station_latitude: constant Mammoth_Footstep := 12; -- where we are > > If these four declarations should be grouped and alignments made at > ':' etc, there will be a problem. Yes. Sometimes you have to take another approach, as I've said above. For this one (depending on what else is nearby), I'd probably put separate it from the others with a blank line and format it differently. > > After all I could argue that an if statement is a table in > nature too, like a case statement. Column borders: if, then, else, end. > Still, what kind of tabular layout is appropriate for an if statement? Sure, but hardly ever are any of the parts short enough to put side by side on a single line AND adjacent to another such 'if' statement to make it worthwhile. > Interestingly, it might be different with case statements where the cases > are short. But would you favour the use of "=>" after "when X" > as a column separator in the same way as ':' in variable declarations? Yes, IF short enough. This also is rare. But when it does happen, I do prefer one of the styles you offered: > case X is > when 1 => letsgo; > when 2 .. 4 => come_on; > when 5 => go_steady; > when 6 | 7 => calm; > end case; > : Notice that I never intended screwing up the comments as your > : strawman suggests. > > It was not my intention to suggest that you screw up comments. But your counterexample was prose such as would only occur in comments. Sorry if I misunderstood your intent.