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,4ee5611d3fbf05b7 X-Google-Attributes: gid103376,public From: John McCabe Subject: Re: Enumeration literal visibility and use type Date: 1998/05/27 Message-ID: <6kgqp5$fn2@gcsin3.geccs.gecm.com>#1/1 X-Deja-AN: 356944431 Content-Transfer-Encoding: 7bit References: <6kej65$dnh$1@hermes.seas.smu.edu| <6kejt5$75u@gcsin3.geccs.gecm.com> <6kensr$fqq$1@hermes.seas.smu.edu> <6kf0r3$isj$1@mulga.cs.mu.OZ.AU> <6kgh82$92n@gcsin3.geccs.gecm.com> <356C45DE.5BF3@praxis-cs.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Organization: GMS&T Newsgroups: comp.lang.ada Date: 1998-05-27T00:00:00+00:00 List-Id: Peter Amey wrote: >Not if suitable names are chosen. Most of the difficulties with Ada >prefixes and dotted names seem to arise because people fight the >language rather than taking advantage of it. Names should be chosen for >their readability in context. I much prefer: > >package Valve is > type T is (Open, Shut); >end Valve; > >allowing: DrainValve : Valve.T := Valve.Shut; > That's not a bad point, but if I say: ValveState : Valve.T := Valve.Shut; then do some processing then I want to check the state of the valve I have to do: if (ValveState = Valve.Shut) then ... when I would rather just say: if (ValveState = Shut) then ... I see the second one as being clearer. Since "Valve" is alonger word than "Shut" and is the first to be read, there is a risk of it reducing the "obviousness" of what is intended, and reducing readability of the code. -- Best Regards John McCabe ===================================================================== Any opinions expressed are mine and based on my own experience. They should in no way be taken as the opinion of anyone I am currently working with, or of the company I am currently working for. If you have a problem with anything I say, SPEAK TO ME! (remove "nospam." to reply by e-mail) =====================================================================