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,88e7ef9008757431 X-Google-Attributes: gid103376,public From: Marin David Condic Subject: Re: Function Calls by Address Date: 1999/09/03 Message-ID: <37D03AA4.D26CF868@pwfl.com>#1/1 X-Deja-AN: 520773618 Content-Transfer-Encoding: 7bit Sender: condicma@bogon.pwfl.com References: <37CADE68.6AF06F5D@escmail.orl.lmco.com> <37CEEFFA.7D73F78D@magic.fr> <7qooh7$hbh$1@nnrp1.deja.com> <37CFFEA6.921CBE59@magic.fr> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii Organization: Pratt & Whitney Mime-Version: 1.0 Reply-To: e108678@pwflcom Newsgroups: comp.lang.ada Date: 1999-09-03T00:00:00+00:00 List-Id: Francois Godme wrote: > I knew about the nested procedures restriction but thought that no one > still uses nested procedures. Personally, I have stopped using them. Why > will I hide a perfectly useful procedure inside another when all I want > is to spare me rewriting over and over the same thing. Are nested > procedures coming from the Pascal heritage where everything was residing > inside the main program? By the same matter, who is still using the > 'separate' construct for writing new applications? I think that the use of child units contributes a lot to better overall code. If nothing else, it helps with configuration management and change control issues by better isolating where changes occur. I never liked the "is separate" and I'm not sure I could tell you why. I wasn't fond of inheriting such a large context which was not immediately visible in the code I was editing. I didn't like the fact that recompiling the parent package would cause recompilation of all the separate units because you effectively hit their specs. That being said, there are still lots of handy reasons for using nested procedures. Sometimes you have a small chunk of code which is repeated frequently, but has no logical cohesion or identifiable function. The nested procedure shortens up the code without creating an essentially purposeless separate unit. Often the nesting of statements can be simplified by breaking up the code into nested procedures. I agree that if a unit is getting into thousands of lines of code due to nesting procedures, it is likely to be a bad thing, but you don't want to throw out a very handy language feature just because excessive use can happen. MDC -- Marin David Condic Real Time & Embedded Systems, Propulsion Systems Analysis United Technologies, Pratt & Whitney, Large Military Engines M/S 731-95, P.O.B. 109600, West Palm Beach, FL, 33410-9600 ***To reply, remove "bogon" from the domain name.*** Visit my web page at: http://www.mcondic.com/