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.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, FREEMAIL_REPLY autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,429176cb92b1b825 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,UTF8 Path: g2news1.google.com!news3.google.com!feeder.news-service.com!94.75.214.39.MISMATCH!aioe.org!.POSTED!not-for-mail From: =?utf-8?Q?Yannick_Duch=C3=AAne_=28Hibou57?= =?utf-8?Q?=29?= Newsgroups: comp.lang.ada Subject: Re: AWS Coding Styles (and about boring plain-linear text files in the end) Date: Wed, 25 May 2011 22:43:00 +0200 Organization: Ada @ Home Message-ID: References: <24418fa4-8843-4fe6-8c2f-026ea6009b68@g26g2000vbz.googlegroups.com> NNTP-Posting-Host: zFVD64CqIn6CIeUFIgGNqw.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes Content-Transfer-Encoding: Quoted-Printable X-Complaints-To: abuse@aioe.org User-Agent: Opera Mail/11.01 (Linux) X-Notice: Filtered by postfilter v. 0.8.2 Xref: g2news1.google.com comp.lang.ada:19480 Date: 2011-05-25T22:43:00+02:00 List-Id: Le Mon, 17 Jan 2011 11:23:12 +0100, pascal.obry@gmail.com = a =C3=A9crit: >> In =E2=80=9C4 Declarations and Types=E2=80=9D : >> >> > All local subprograms in a subprogram or package body >> > should be declared before the first local subprogram >> > body. >> >> Q: Why this requirement of a declaration for body's and >> procedure's local subprograms ? Is it to avoid the >> need to order subprogram bodies with respect to their >> dependencies to each others ? (if so, this would >> be contradictory with previous quote). > > First this force having a spec and the spec must be commented. > Second it is better to group all specs together for maintenance > and code review. You have all local subprograms in a single > place. This also force consistency, because without a prior declaration, = subprograms which are specific to package body comments about the = signature comes with the subprogram implementation, while comments about= = the signature of subprograms defined in the specification, comes at the = = signature declaration. This lead to inconsistent layout, so it is indeed= = better for this second reason two : comments always comes with = specification, instead of some with specification and some with = implementation. Another third reason, is that this more clearly emphases distinction = between subprograms specific to package body and the others. Without thi= s, = if one meet a subprogram implementation, he/she don't know if this = subprogram in internal or defined in the specification. About the latter: this makes me recall it happens I feel this may be an = = idea to have a way to clearly mark (a keyword ?) a subprogram = implementation as being the one of a subprogram declared in a package = specification or not. This could improve readability, especially when = defensive programming is a concern. Or=E2=80=A6 alternatively, smart eno= ugh = editors could automatically tag this, and make this tag clearly visible = = within the UI (ASIS could help). -- = Si les chats miaulent et font autant de vocalises bizarres, c=E2=80=99es= t pas pour = les chiens. =E2=80=9C c++; /* this makes c bigger but returns the old value */ =E2=80= =9D [Anonymous]