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: 103376,6960ceaa57428e2f X-Google-Attributes: gid103376,public From: Lao Xiao Hai Subject: Re: Another important feature of Ada Date: 2000/11/19 Message-ID: <3A184F9B.76DB27C3@ix.netcom.com>#1/1 X-Deja-AN: 695540842 Content-Transfer-Encoding: 7bit References: <3A12041B.BCFD8CA0@worldnet.att.net> X-Accept-Language: en X-Server-Date: 19 Nov 2000 22:14:19 GMT Content-Type: text/plain; charset=us-ascii Organization: MindSpring Enterprises Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 2000-11-19T22:14:19+00:00 List-Id: James Rogers wrote: > I have been following a thread between comp.lang.eiffel and > comp.lang.c++.moderated. The thread is boiling down to a discussion of > the virtues and vices of separating interface from implementation. > > The points being made against sepration of interface and implementation > focus on a concept that duplication of code is BAD, and separation > of interface and implementation requires some duplication of code. First, I like much of the Eiffel language design and would like to see Ada adopt a few of its features. Second, I prefer the Ada model of physically separating the interface from the implementation. In reliability theory, there is a notion of parallel redundancy that is often introduced to improve the chances of a correct result. I see Ada compilation model as somewhat analogous to the parallel redundancy practice. On large-scale software development projects, where more than one person is engaged in developing the code, this redundancy serves as an additional level of checking between specification and implementation. While this same effect can be achieved, to some extent in Eiffel, and to a much lessor extent in C++, Ada is unique in its enforcement. Ada does not even allow implementation code in the specification. The other languages mentioned do permit it. C++ even requires implementation code in the class definition under some silly circumstances We are dealing here with programmers, most of whom are endowed with a certain measure of humanity. With human programmers, if something can be done it will be. This includes succumbing to the temptation to start implementing algorithmic code too early in the process. I am as guilty as anyone else of thinking about how I plan to solve a problem before fully considering what problem I am trying to solve. Separating the specification from the implementation presents a simple but effective obstacle to premature implementation. Ada, as readers of this forum understand, even allows us to defer implementations to small separately compiled subunits which, in-turn, provide excellent opportunities for controlling dependencies, as well as focusing longer on the "what" before getting involved in the "how.". Eiffel programmers will retort that they can do the same thing. I agree, they can. However, being able to do something and doing it are two different things. Ada requires the separation. The argument about duplication of code is not very convincing. Are we looking for ways to make coding easier or are we looking for a language design that enforces a higher level of discipline in the software engineering process? Richard Riehle