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=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.ada Subject: Re: Why .ads as well as .adb? Date: Thu, 06 Jun 2019 12:42:38 -0700 Organization: None to speak of Message-ID: References: <28facad3-c55f-4ef2-8ef8-004925b7d1f1@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: reader02.eternal-september.org; posting-host="0ad8b66ef2f1a8fe8c740ae2f33d0263"; logging-data="1082"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/5wJFueD8lwtelDiNHs9+u" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:O9CambBYFDjo0VZN5867PCd2GDY= sha1:SSVmXS9goLLJejQjtY7Rq2ZKm2E= Xref: reader01.eternal-september.org comp.lang.ada:56503 Date: 2019-06-06T12:42:38-07:00 List-Id: Maciej Sobczak writes: >> > This style is promoted by all industrial coding standards (both >> > C and C++ language standards examples, MISRA-C, JSF, HICPP, AUTOSAR, >> > ...), so I don't get the argument about "rarity". >> > >> > Actually, I don't even know where to find something different. >> >> The two most common layouts for C code are: > [...] > > Of course. But as pointed above, the vertically-aligned braces are > promoted by all industrial coding standards and are used in code > examples of the language standards themselves. And I see them in > classic books. And I see them in major open source code bases. Hence > my comment about the argument that "most" C code is smushed > together. I just don't see that. (But I know Java coders who, when > forced to put their dignity aside, would actually write C code this > way.) This is off-topic, but the style used in the documents that define the C and C++ languages is to put the opening "{" for a function definition on a line by itself, but the opening "{" for any control structure (if/while/for) is at the end of the line. (There are historical reasons for the difference, which I won't go into.) int func(int arg) { if (arg > 0) { do_this; } else { do_that; } } It's also common to put the opening "{" for the function at the end of the line. -- Keith Thompson (The_Other_Keith) kst-u@mib.org Will write code for food. void Void(void) { Void(); } /* The recursive call of the void */