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.3 required=5.0 tests=BAYES_00,INVALID_MSGID 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: f43e6,2c6139ce13be9980 X-Google-Attributes: gidf43e6,public X-Google-Thread: 103376,3d3f20d31be1c33a X-Google-Attributes: gid103376,public From: "W. Wesley Groleau x4923" Subject: Re: Interface/Implementation (was Re: Design by Contract) Date: 1997/08/28 Message-ID: <34058E71.240A@pseserv3.fw.hac.com>#1/1 X-Deja-AN: 268764725 Sender: usenet@most.fw.hac.com (News Administration) References: <33E9ADE9.4709@flash.net> <34046FAD.52BFA1D7@eiffel.com> <34048FDC.13728473@eiffel.com> <3404909F.2C67412E@eiffel.com> X-Nntp-Posting-Host: sparc02 Organization: Hughes Defense Communications Newsgroups: comp.object,comp.software-eng,comp.lang.ada,comp.lang.eiffel Date: 1997-08-28T00:00:00+00:00 List-Id: Patrick Doyle wrote: > Bertrand Meyer wrote: > >The goals are clear: > > I agree with most of these goals, but I have an issue with one > of them: I'm still looking at them (actually, waiting for enough free time) but I also disagree for similar reasons with this one: > > G5. Minimize the programmer's work. ..... > ..... Duplication is almost always > > bad, especially with respect to ease of maintenance, > > one of the central goals of software engineering. > > It also hampers reuse, reliability (when you > > duplicate code, you duplicate its bugs, and > > the more software you write the more likely > > it is that it will include bugs), and ease > > of change. > 1. Too much typing > 4. Too hard to change This is what a C bigot would say. An Ada bigot (indeed, everyone on the Ada side of the average) would say, "Absolutely not an issue" (1) & (4) are almost the same, but discouraging change (4) in a SPEC (interface) is a Good Thing. > 2. Duplicate code duplicates bugs > 3. More code means more bugs Both of these are incorrect in this case. A bug that is repeated is still only one bug IF it is repeated in the parts of the spec/body that are required to conform by the language. I could add another argument that others have already offered: 5. A corollary of Murphy's law is that duplicate information will inevitably become non-duplicate. This argument is applicable in C, where header files can easily not match the implementation, yet still compile. It does not apply to Ada specs and bodies, since duplication that is required is compiler-enforced to be a perfect match. You can't even deviate as much as spec: Proc ( X : Pkg.X_Type ); body: package P renames Pkg; Proc ( X : P.X_Type ) is ... And duplication that is not required is not allowed (such as redeclared variables). -- ---------------------------------------------------------------------- Wes Groleau, Hughes Defense Communications, Fort Wayne, IN USA Senior Software Engineer - AFATDS Tool-smith Wanna-be wwgrol AT pseserv3.fw.hac.com Don't send advertisements to this domain unless asked! All disk space on fw.hac.com hosts belongs to either Hughes Defense Communications or the United States government. Using email to store YOUR advertising on them is trespassing! ----------------------------------------------------------------------