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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,4c459ff0adb576bc X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-02-06 09:22:14 PST Newsgroups: comp.lang.ada Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.cwix.com!news.umass.edu!world!news From: Robert A Duff Subject: Re: Refactoring and Ada Sender: news@world.std.com (Mr Usenet Himself) Message-ID: Date: Wed, 6 Feb 2002 17:19:43 GMT References: <3C5AB0B7.9D75D49A@grammatech.com> <3C5E0ED6.E2D52BD3@adaworks.com> <3C5EBEF0.FFC7D48@adaworks.com> NNTP-Posting-Host: shell01.theworld.com Organization: The World Public Access UNIX, Brookline, MA X-Newsreader: Gnus v5.7/Emacs 20.7 Xref: archiver1.google.com comp.lang.ada:19672 Date: 2002-02-06T17:19:43+00:00 List-Id: Richard Riehle writes: >...It would be a disaster, in > the given program if a maintenance programmer were to test for less-than when > I wanted greater-than. The renaming trick can actually *cause* that problem: function "and"(X, Y: T) return T renames Mumble."and"; function "or"(X, Y: T) return T renames Mumble."and"; Oops. A cut-and-paste bug. The problem is that renaming is too powerful for this purpose: renaming allows you to change the name of the thing, which you don't want to do 9 times out of 10. In this case, you just wanted to import the thing, without actually renaming it. And the reader won't notice this bug easily, because there are thousands of lines of these boring renamings; the reader thinks, "yeah, yeah, yeah, I already know what that says, I need not read it carefully". - Bob