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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,7eaf9f2597de2259 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-10-05 10:32:23 PST Newsgroups: comp.lang.ada Path: archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!news.tele.dk!small.news.tele.dk!212.177.105.133!news.mailgate.org!zur.uu.net!ash.uu.net!xyzzy!nntp From: Jeffrey Carter Subject: Re: on package naming, should the word "_pkg" be part of it? X-Nntp-Posting-Host: e246420.msc.az.boeing.com Content-Type: text/plain; charset=us-ascii Message-ID: <3BBDE9BA.CF042BC9@boeing.com> Sender: nntp@news.boeing.com (Boeing NNTP News Access) Content-Transfer-Encoding: 7bit Organization: The Boeing Company X-Accept-Language: en References: <9pif1o01btl@drn.newsguy.com> <9pii95$jus$1@nh.pace.co.uk> <3bbd7a77.5463085@news.demon.co.uk> Mime-Version: 1.0 Date: Fri, 5 Oct 2001 17:11:22 GMT X-Mailer: Mozilla 4.5 [en]C-CCK-MCD Boeing Kit (WinNT; U) Xref: archiver1.google.com comp.lang.ada:13804 Date: 2001-10-05T17:11:22+00:00 List-Id: John McCabe wrote: > > type Car_Type is > record > .... > end record; > > procedure DoSomething (Car : in out Car_Type); > > could be replaced by: > > type Car is > record > .... > end record; > > procedure DoSomething (The_Car : in out Car); I recall reading articles about the psychology of understanding programs (sorry, Robert Dewar, I don't have references for this, either. Hopefully it's not just random neurons firing in my brain) that stated that the first few characters of an identifier are the most important in determining what you're reading. Having identifiers that are identical for the first few characters requires more time and effort to understand, and results in more errors in understanding. Although both _Type and The_ are ways to resolve the type/parameter name conflict, The_ is worse because it makes the first four characters of every parameter name the same. I make the type name reflect what the type contains. For example type Car_Info ... procedure P (Car : in Car_Info ... This is not a popular approach, though, because it requires thought about every type name. -- Jeffrey Carter