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, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,8b756d9a0afb052a X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!news2.volia.net!npeer.de.kpn-eurorings.net!newsfeed.arcor.de!news.arcor.de!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Quick question about Ada code formatting. Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.14.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: Date: Sun, 19 Feb 2006 11:02:36 +0100 Message-ID: <1q0e240g8sgz.z8mm8w2gjn84.dlg@40tude.net> NNTP-Posting-Date: 19 Feb 2006 11:02:26 MET NNTP-Posting-Host: 982b91f2.newsread4.arcor-online.net X-Trace: DXC=bf\nMH5iO5\kVRFeeUa4iQ:ejgIfPPldTjW\KbG]kaMXGAlE^3P3k5U1KW=?7kGQP\mWkfB4cNm_PgT\1QI\6KS_`BmOV:Y On 18 Feb 2006 12:19:59 GMT, Peter C. Chapin wrote: > I realize formatting style varies from person to person and from > organization to organization. Nevertheless some programming language > communities have definite community standards about how certain language > constructs should be formatted. For example, it seems universal in this > community to name variables This_Way. > > When it comes to calling subprograms I've seen some sources that put a > space between the name of the subprogram and the argument list. > > My_Procedure (X, Y, Z); > A := My_Function (B); > > When wrapping such calls the entire argument list is moved down to the > next line. > > My_Procedure > (Very_Long, Argument_List, With_Many, Arguments); > > In other communities (C/C++) it is more common to leave the space out > and also to leave the opening '(' on the same line as the procedure > name. > > I'm wondering how universal the above style is among Ada programmers. In > other words: would it be desirable for me to adopt it as part of my > personal style guide? I do it this way. My_Procedure ( A => X, -- Place for a comment B => Y, C => Z ); Opening and closing brackets have same indentation. > P.S. Is there an accepted indentation depth among Ada programmers? I use 3, because it conforms with name length of the most of operations, which I always put first on each new line. For example, a long formula (to be avoided if possible): X := ( ( Y + Z + ... ) / 100 ); Though it does not well fit for "and", "and then", "or else". Anyway if My_Function need called there, it becomes: X := ( ( Y + My_Function ( Arg1 => Something, Arg2 => 34 / Z, ... ArgN => K -- It's a bad idea to have long argument lists ) ) / 100 ); -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de