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: Brian Rogoff Subject: Re: Another important feature of Ada Date: 2000/11/15 Message-ID: #1/1 X-Deja-AN: 693964062 References: <3A12041B.BCFD8CA0@worldnet.att.net> <8uud86$c22$1@nnrp1.deja.com> Content-Type: TEXT/PLAIN; charset=US-ASCII X-Complaints-To: abuse@verio.net X-Trace: sjc-read.news.verio.net 974307416 206.184.139.136 (Wed, 15 Nov 2000 16:56:56 GMT) Organization: Verio MIME-Version: 1.0 NNTP-Posting-Date: Wed, 15 Nov 2000 16:56:56 GMT Newsgroups: comp.lang.ada Date: 2000-11-15T00:00:00+00:00 List-Id: On Wed, 15 Nov 2000 mjsilva@my-deja.com wrote: > In article <3A12041B.BCFD8CA0@worldnet.att.net>, > 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. > > I wonder how it could be otherwise? In Ocaml, the interface file contains ony the type signature of functions in the implementation file, and there is no need to repeat the type information again in the implementation file. So admittedly there is some duplication (the name of a function) but much less than in Ada. There is actually no need to right a .mli file (equivalent to a .ads in GNAT) for each .ml (= .adb) unless you want to restrict what is visible or provide the ability for others to compile without the full implementation. However, this duplication has never been a significant issue for me in Ada, or even C (my C code is very Ada-like) so I often wonder why people whine about this so much. I did a bit of programming in Sather and Eiffel a while ago and I have to admit that while there are lots of nice features in those languages I prefer Ada, and this separation, redundancy and all, plays a large part in that preference. -- Brian