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: fac41,2c6139ce13be9980 X-Google-Attributes: gidfac41,public X-Google-Thread: 1108a1,2c6139ce13be9980 X-Google-Attributes: gid1108a1,public X-Google-Thread: 103376,3d3f20d31be1c33a X-Google-Attributes: gid103376,public X-Google-Thread: f43e6,2c6139ce13be9980 X-Google-Attributes: gidf43e6,public From: nospam@thanks.com.au (Don Harrison) Subject: Re: Interface/Implementation (was Re: Design by Contract) Date: 1997/09/10 Message-ID: #1/1 X-Deja-AN: 271447948 Sender: news@syd.csa.com.au References: Reply-To: nospam@thanks.com.au X-Nntp-Posting-Host: dev50 Organization: CSC Australia, Sydney Newsgroups: comp.object,comp.software-eng,comp.lang.ada,comp.lang.eiffel Date: 1997-09-10T00:00:00+00:00 List-Id: Tucker Taft wrote: :Don Harrison (nospam@thanks.com.au) wrote: : :: ... : :: 1) The most important reason is that compulsory backward references force :: the developer to order everything (apart from things defined in the spec) :: from low level to high level.. : :This may be a practice-versus-capability issue again. There is :nothing precluding the use of separate declarations, even if the :subprogram is local to the body. One typical coding style adopted :for Ada package bodies is: : : : : : : : :Given this style, the bodies can be ordered in any way that is convenient. Good idea. Although I consider it a workaround, it effectively deals with the problem. Thanks. :You might recommend that your programmers adopt the above style. I'll recommend it be included in the style guide. : :: 2) It's problematic when an exported feature is removed from the spec (perhaps :: because it's erroneously exported) and you have to re-order the body to :: accomodate dependencies.. : :This can certainly be accommodated by putting the separate declaration :at the top of the body when it is removed from the spec. There is really :no need to reorder. Here is where a common coding convention could really :help. Agree. :It may be that experience with Pascal would tend to think of separate :declarations as the exception, rather than the rule, but there is :no reason for that view in Ada. In Pascal, having a separate "forward" :declaration was somewhat disruptive, because the parameter profile then :disappeared from the body, which I at least found hindered readability :of the body. I agree omitting the profile is a bad idea. So, Ada's forward references are an improvement over Pascal's. Of course, I prefer not having to duplicate anything at all for redundancy reasons. Don. (Reverse to reply) =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Don Harrison au.com.csa.syd@donh