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,7f4d16c4ee371eb5 X-Google-Attributes: gid103376,public From: Robert A Duff Subject: Re: Why is it Called a Package? Date: 2000/03/27 Message-ID: #1/1 X-Deja-AN: 603053338 Sender: bobduff@world.std.com (Robert A Duff) References: <38DF7F38.8D656ABD@lmtas.lmco.com> <2000Mar27.111655.1@eisner> Organization: The World Public Access UNIX, Brookline, MA Newsgroups: comp.lang.ada Date: 2000-03-27T00:00:00+00:00 List-Id: kilgallen@eisner.decus.org (Larry Kilgallen) writes: > In article <38DF7F38.8D656ABD@lmtas.lmco.com>, Gary Scott writes: > > Admittedly a "fluff" question... > > > > I notice that a lot of modern languages choose names/syntax that I > > personally do not find intuitive. Other languages contain basically the > > same feature but call it by different names (module, etc.). Why was > > "package" considered the intuitive name for this feature? Well, a package in real life is a thing that contains a collection of other things, all wrapped up together, which is sort of like what an Ada package is. Anyway, programming language design is too immature to have a standard terminology. You can't blame Ada for choosing "package" any more than you can blame some other language for using "module" or "cluster". They're all pretty reasonable names, IMHO. > I was not there when the decision was made, but I would presume the > goal was to _avoid_ using a familiar name since other languages do > not typically have something that behaves in this fashion. If one > were to propose the term "module", for instance, those who knew > other programming languages and were learning Ada might presume > that it worked like a "module" in those other languages, and they > would be wrong. > > I program in several languages that have "modules" and those "modules" > do not support separately compiled specifications and bodies, cannot > be nested within other "modules", etc. I wasn't there either, but I doubt if that was the goal, and I don't think it *should* be the goal. First of all, Ada's packages are pretty much like Modula-2 modules (which by the way *can* be nested and *can* have separate spec/body). Even in languages that don't allow those things, the concept is close enough that it would not be confusing to have the same name. Ada's procedures don't work exactly like Pascal's procedures, either. For example parameter passing is completely different. But the two things serve the same basic purpose, so it makes sense to call them by the same name. Too bad other languages call them "functions" or "void functions" or "methods" or "subroutines". By the way, I'm told (by Robert Dewar, I think) that it *was* a goal of Ada 83 to avoid the term "pointer" -- hence the term "access type", to distinguish between Ada's pointers (relatively type safe) and the kinds of pointers found in (eg) C. I don't like that idea -- Ada's pointers, although different from C's, serve something of the same purpose -- enough to call them by the same name. Anyway, Ada is based on Pascal, not C, and Pascal's pointers are just like Ada-83's. Calling them "accesses" serves only to confuse newcomers. - Bob