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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Vocabulary matter: Component vs Element vs Item Date: Fri, 26 Jul 2013 08:59:46 +0100 Organization: A noiseless patient Spider Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: mx05.eternal-september.org; posting-host="d88aa8a0fafe4f7fb3eb325f8f3d97d0"; logging-data="5358"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/0W375tUxApgAbM8bKXiHTBa4CCLcg+9o=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (darwin) Cancel-Lock: sha1:7wgNB3M/NtUPCLJr1lUi4sA6+pg= sha1:H0HWdWzyoFzyKXoUbetSHqD1DCo= Xref: news.eternal-september.org comp.lang.ada:16520 Date: 2013-07-26T08:59:46+01:00 List-Id: "Yannick Duchêne (Hibou57)" writes: > Le Thu, 25 Jul 2013 21:01:38 +0200, Simon Wright > a écrit: > >> "Yannick Duchêne (Hibou57)" writes: >> >>> All three words "component", "element" and "item" could be seen as >>> interchangeable in plain English (or am I wrong?). >> >> I have a feeling that in English (BrE) "component" and "element" are >> more-or-less synonymous, but "item" isn't. "The solution to the >> problem has five Xs" - X could be component or element, but not item; >> an item is a thing on its own, whereas a component or an element is >> one of many. > > Sounds correct. > >> So I think that the Ada Containers match this notion: a container can >> have elements (of element_type, eeew), and you replace one of them by >> an item. >> >> I see that the Booch Components have this the other way round: >> >> procedure Insert (C : in out Abstract_Collection; Elem : Item) >> is abstract; > > After your note above, I now less feel it's an issue to mix both in a > same domain (or package, to speak Ada). Remains the case you point > with the swapped choice made in the Booch Components. > > May be a way to solve it, is to have an Element_Type which is a > subtype (as a type aliasing) of Item_Type. This would allow to have > both mixed case while having consistency between an argument name and > its type (there are cases where it's better to simply name a thing > after its type). I don't think anyone should take the design choices made in the BCs in 1998 as being in any way definitive. I didn't choose Item/Elem, and I suspect that a lot more effort went into Ada.Containers naming conventions (they were at least reviewed by the ARG!). And the BCs are definitely in maintenance now!