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-Thread: 103376,e55245590c829bef X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,UTF8 Path: g2news2.google.com!news3.google.com!feeder3.cambriumusenet.nl!feed.tweaknews.nl!193.201.147.78.MISMATCH!feeder.news-service.com!85.214.198.2.MISMATCH!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Beginners question: Compound types, how-to? Date: Tue, 02 Nov 2010 20:24:12 +0000 Organization: A noiseless patient Spider Message-ID: References: <86wroy58ff.fsf@gareth.avalon.lan> <86pqup5xfy.fsf@gareth.avalon.lan> <86y69d3rec.fsf@gareth.avalon.lan> <82lj5c5ecm.fsf@stephe-leake.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: mx03.eternal-september.org; posting-host="dFCm8HWntFqmDIilBLqEJQ"; logging-data="648"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18DyhYSpcuAekx6sIAcofYfXMxOYqNL3kY=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (darwin) Cancel-Lock: sha1:35KNshr1efQE7q8GyYnj7qdjDjI= sha1:jiivyh6LbzkYugYJjrz2pMuml6Y= Xref: g2news2.google.com comp.lang.ada:16120 Date: 2010-11-02T20:24:12+00:00 List-Id: "Yannick DuchĂȘne (Hibou57)" writes: > Le Tue, 02 Nov 2010 20:02:25 +0100, Jeffrey Carter > a Ă©crit: > >> On 11/02/2010 01:17 AM, Stephen Leake wrote: >>> >>> _Type vs "waste time thinking up other names" is a religious >>> argument (guess which side I'm on?); it has never been settled >>> before, and won't be settled this time. >> >> Those who think the essential S/W-engineering activity of choosing >> good names is a waste of time are clearly not S/W engineers. > What is the choice of _Type (or _Xyz) if not a choice about names ? (a > consistent choice by the way) Consistent with what? You can't quote File_Type, Buffer_Type from the ARM without explaining Integer, Float etc (I think these different styles must have come from different authors). I _think_ that Jeffrey's point is that, given weapons such as broadsword, catapult, torpedo you might write C like typedef enum {BROADSWORD, CATAPULT, TORPEDO} Weapon; void attackUsing(Weapon weapon); and rather than write this in Ada type Weapon_Type is (Broadsword, Catapult, Torpedo); procedure Attack_Using (Weapon : Weapon_Type); it would be better to say type Weapon is (Broadsword, Catapult, Torpedo); procedure Attack (Using : Weapon); Anyway, that's what my project style guide says.