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,2afac1a4161c7f35 X-Google-Attributes: gid103376,public From: mheaney@ni.net (Matthew Heaney) Subject: Re: Two simple language questions (plural types) Date: 1998/01/10 Message-ID: #1/1 X-Deja-AN: 314719377 Content-Transfer-Encoding: 8bit References: <68uq34$7tk@tomquartz.niestu.com> <697p89$b5j@top.mitre.org> Content-Type: text/plain; charset=ISO-8859-1 Organization: Estormza Software Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 1998-01-10T00:00:00+00:00 List-Id: In article , dewar@merv.cs.nyu.edu (Robert Dewar) wrote: >For my tastes, I find the use of plurals to be highly (almost deliberately) >confusing. > >Here the variable color is said to be something to do with colors, which >to me strongly implies that it is a set of colors or somesuch. Hallelujah! Robert, once again you bring order to chaos. I completely agree that plural names should be used to denote, well, plural objects - aggregates of some kind. For example, if I have a color object that stores the value of a single color, then of course the singular declaration The_Color : Color; is preferred. If I see The_Color : Colors; well then my instinct is to assume that The_Color is an aggregate of some kind, and I would expect to see references like ... The_Color (1) ... (assumes it's an array). I generally do this sort of thing: type Color is ... type Color_Array is array (Positive range <>) of Color; type Color_Stack is ... type Color_Set is ... I usually name array objects with a plural name, because, well, it's a plural object: Colors : Color_Array; I don't buy the argument that we should compare Ada text to English text. The text of a computer program has its own idioms (including the one described above), so a comparison to natural languge is not appropriate. Do not use a plural name for a singular type. If you're not convinced, read the RM: Integer is not called Integers. Float is not called Floats. Address is not called Addresses. File_Type is not called File_Types. File_Mode is not called File_Modes. In fact, I'd like someone to point out anywhere in the RM where a plural name is used for a singular object. Why don't Ada programmers use the idioms in the Ada RM? It's VERY CONFUSING when you don't. Please, do not use a plural name for a type whose instances denote a single value. -------------------------------------------------------------------- Matthew Heaney Software Development Consultant (818) 985-1271