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.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ec4cde5d799065b6 X-Google-Attributes: gid103376,public From: aquantz@ibm.net (Aaron Quantz) Subject: Re: Coding Standards & GOTO Date: 1997/09/24 Message-ID: <34293aec.147359141@news2.ibm.net>#1/1 X-Deja-AN: 275277377 References: <01bcc32e$350b5ba0$6409868b@gateway> <5vqm61$fu2$1@cf01.edf.fr> <3422F037.41CA@lmco.com> <3423AF1B.5152@i.b.m.net> <3426B51E.7296@lmco.com> Organization: HR Textron Reply-To: aquantz@ibm.net Newsgroups: comp.lang.ada Date: 1997-09-24T00:00:00+00:00 List-Id: And don't forget, the most important place to accept deviations to your CONCRETE rules is during your format code walkthrough. The deviation can be explained and accepted/rejected on a case-by-case basis. mheaney@ni.net (Matthew Heaney) wrote: >In article <3426B51E.7296@lmco.com>, William.Dale.Jr@lmco.com wrote: > > >>As my charter for implementing a new Ada 95 standard is to have only >>absolute rules that cannot be violated, > >You are setting yourself up for failure, as there is no such thing as an >absolute rule. > >>I am forced to through out most >>of AQ&S as mearly advice. > >Why the pejorative "merely advice"? That's exactly what a coding standard >should be, advice on how to use language. > >Read the section of OOSC-2 that discusses the difference between a rule and >a guideline. > >>A major segment wants to use GOTO's ( visible >>objects in specs too ). I'd use the AQ&S right out of the box if I >>could. > >A "rule" comprises "guidelines," plus a list of the times when the >guidelines don't apply, ie > >rule = guidelines + exceptions > >For example, state your rule for the use of goto as follows: > >Rule For The Use Of The Goto Statement > >Guideline: >o Use higher-level control structures such as if, case, and loops, rather >than a goto. > >Exceptions: >o Use a goto when you're mechanically translating code from another >language into Ada (example, converting from Fortran to Ada, or when you're >using a scanner generator that emits Ada code). > >o Use a goto when you're hand-coding a finite state machine, such as a scanner. > >End of Rule > > >And what's wrong with objects in the spec? Have you read Ada.Text_IO >lately? Again, this calls for guidelines for when to declare an object in >the spec, and when not to. For example, when implementing a subsystem, >then an object shared among packages in the same subsystem can be declared >in the spec of a private package. > >Also, a well-known object, used throughout the system, can be declared in a >spec: > >package Targets.Objects is > > type Target_Array is array (Positive range 1 .. 20) of Target; > > The_Targets : Target_Array; > >end; > >What's wrong with that? > > >>Advice will be ignored, I'm sure, as all programmers know what's best >>for their code. ;-) > >Not all programmers do know, and they appreciate the help. Check out >Taligent's Guide to Designing Programs. > >-------------------------------------------------------------------- >Matthew Heaney >Software Development Consultant > >(818) 985-1271 Regards, Aaron Quantz \^ ^/ )@ @( +---------------------------oOO--(_)------------------------------------+ + Mgr Software Development, Turret Control Systems + + HR Textron | Phone: (805) 253-5471 + + 25200 W. Rye Canyon Rd. | Fax: (805) 253-5962 + + Valencia, CA USA 91355-1265 | Email: aquantz@ibm.net + + Visit the Textron web site: http://www.textron.com + +-----------------------------------Oooo--oOO---------------------------+ oooO ( ) ( ) ) / \ ( (_/ \_)