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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,b076e6315fd62dc5 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Received: by 10.68.138.199 with SMTP id qs7mr199775pbb.1.1336639412664; Thu, 10 May 2012 01:43:32 -0700 (PDT) Path: pr3ni9298pbb.0!nntp.google.com!news2.google.com!postnews.google.com!w10g2000vbc.googlegroups.com!not-for-mail From: Maciej Sobczak Newsgroups: comp.lang.ada Subject: Re: fyi, very interesting Ada paper OOP vs. Readability Date: Thu, 10 May 2012 01:43:32 -0700 (PDT) Organization: http://groups.google.com Message-ID: <5b160875-1ac9-4764-b36f-1a02314e0950@w10g2000vbc.googlegroups.com> References: NNTP-Posting-Host: 195.182.34.254 Mime-Version: 1.0 X-Trace: posting.google.com 1336639412 7483 127.0.0.1 (10 May 2012 08:43:32 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 10 May 2012 08:43:32 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: w10g2000vbc.googlegroups.com; posting-host=195.182.34.254; posting-account=bMuEOQoAAACUUr_ghL3RBIi5neBZ5w_S User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows NT 6.1; rv:12.0) Gecko/20100101 Firefox/12.0,gzip(gfe) Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Date: 2012-05-10T01:43:32-07:00 List-Id: On May 10, 4:33=A0am, "Randy Brukardt" wrote: > People hate it when I write: > > =A0 =A0 =A0 =A0 =A0 if Ada.Strings.Unbounded."=3D"(My_String, > Ada.Strings.Unbounded.To_Unbounded_String ("open") then ... > > because I refuse to use use clauses in almost all instances. Interestingly, this is a single case where I'm ready to make an exception and allow the use clause. The reason is not only to make the above more readable, but to actually admit that Unbounded_String and String should have equal treatment. The fact that they come from different packages and one of those packages has the privilege of having "implicit clause" is a details that should not be exposed. After all, Unbounded_String and String both represent the same high- level design concept (that is, they represent the same concept at the data modeling stage, for example) and differ only in some tradeoffs, like the set of operations vs. memory usage scheme. These low-level tradeoffs are not enough to keep these two type so apart, so I usually do use Unbounded and later write without hesitation for example: procedure Do_Something (A : in String, B : in out Unbounded_String); without unnecessary package qualifications. In short: String and Unbounded_String represent the same concept and should have equal "coding look and feel". -- Maciej Sobczak * http://www.msobczak.com * http://www.inspirel.com