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=ham 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!news1.google.com!news4.google.com!news.glorb.com!newsfeed.stueberl.de!newsfeed.vmunix.org!peer-uk.news.demon.net!kibo.news.demon.net!news.demon.co.uk!demon!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Quick question about Ada code formatting. Date: Sat, 18 Feb 2006 13:26:25 +0000 Organization: Pushface Message-ID: References: NNTP-Posting-Host: pogner.demon.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: news.demon.co.uk 1140269187 2243 62.49.19.209 (18 Feb 2006 13:26:27 GMT) X-Complaints-To: abuse@demon.net NNTP-Posting-Date: Sat, 18 Feb 2006 13:26:27 +0000 (UTC) Cancel-Lock: sha1:J6jOKv3G/m8II4XUkEL2aLiszPE= User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (darwin) Xref: g2news1.google.com comp.lang.ada:2954 Date: 2006-02-18T13:26:25+00:00 List-Id: "Peter C. Chapin" writes: > 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? > > Peter > > P.S. Is there an accepted indentation depth among Ada programmers? I've > seen three spaces in several places and I notice both Ada-mode in Emacs > and GPS use three spaces by default. On my current project we decided to use the formatting provided by GLIDE/GPS and to use the -gnaty switch to check it. You can give a whole slew of options to -gnaty but it seems far easier to just accept the defaults even if they aren't what you would be used to. The 3 space indent is a case in point; of course if your editor just does it for you it's not so hard to accept! What always baffles me is how people will *not* train themselves to do what the style checker expects, and will *not* just fix the style warnings as they go.