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!.POSTED!not-for-mail From: "Jeffrey R. Carter" Newsgroups: comp.lang.ada Subject: Re: Type naming conventions: Any_Foo Date: Sat, 7 Dec 2019 11:28:01 +0100 Organization: Also freenews.netfront.net; news.tornevall.net; news.eternal-september.org Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Sat, 7 Dec 2019 10:28:01 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="64ebb0f37a42dfa81055c295c2af9659"; logging-data="23479"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18iaJ07jJKrBYvNzh4tScvBUcPOfW2u3Lo=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.1 Cancel-Lock: sha1:b1vVYh/uF+S8iDCbemc/glrDO3g= In-Reply-To: Content-Language: en-US Xref: reader01.eternal-september.org comp.lang.ada:57685 Date: 2019-12-07T11:28:01+01:00 List-Id: On 12/7/19 1:57 AM, Randy Brukardt wrote: > > Agreed. Ada.Containers all have a function Element that retrieves a (copy > of) a single element object from the container. If the type was named > element, what would this function be called? Similarly, some of the > parameters are called Element (thus, Element : Element_Type in many > parameter lists); those also would need alternate names. At a conference long ago (probably in the Ada-83 days), a presenter claimed that well designed Ada has 90% of its operations named Put or Get. Get is an appropriate name for such an operation. More specifically, good names may depend on the data structure. When the normal Get operation modifies the structure, as for queues and stacks, Peek is a good name. Value is a good name for most other cases. Parameters of the type should be named Item. -- Jeff Carter "C++ is like jamming a helicopter inside a Miata and expecting some sort of improvement." Drew Olbrich 51