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: f43e6,9a0ff0bffdf63657 X-Google-Attributes: gidf43e6,public X-Google-Thread: 103376,4b06f8f15f01a568 X-Google-Attributes: gid103376,public X-Google-Thread: 1108a1,9a0ff0bffdf63657 X-Google-Attributes: gid1108a1,public From: behrends@cse.msu.edu (Reimer Behrends) Subject: Re: Software landmines (loops) Date: 1998/10/15 Message-ID: #1/1 X-Deja-AN: 401279340 References: <1dghyt5.oik1lzhxzf2N@n207167116176.inetworld.net> <1dgt6f1.1oau40z1p1ueeuN@n207167116181.inetworld.net> <3624700D.52F1@dmu.ac.uk> Organization: Michigan State University Newsgroups: comp.object,comp.software-eng,comp.lang.ada Date: 1998-10-15T00:00:00+00:00 List-Id: Graham Perkins (gperkins@dmu.ac.uk) wrote: [...] > Also we often find "main program" which consists of a single procedure > call, and many individual procedures which consist of nothing but > two or three parameter-less procedure calls. > > We try to reform such people before they graduate!! But many > slip through. Well, I hope so. :) An abstraction (procedure or class) is a good abstraction because it embodies a useful concept, not because it saves space. void f() { g(); } is a perfectly legitimate construct, with the obvious benefit that you can at any time change the implementation of f() from g() to h() without affecting the code that uses it. Imagine for instance the case of writing an anonymous mailer, where you want to eliminate all uses of the "From" address and replace it by a dummy. (Say, for anonymous feedback in a class.) Now, if there is a uniform function string from_address() { return user_name(); } then you can just change this single function. However, if user_name() were used all over the place, making the change is anything but pleasant. (Extra points for spotting the reference and noticing that it is anything but fictitious.) [...] Reimer Behrends