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,b076e6315fd62dc5 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.200.227 with SMTP id jv3mr162854pbc.6.1336783048523; Fri, 11 May 2012 17:37:28 -0700 (PDT) MIME-Version: 1.0 Path: pr3ni15489pbb.0!nntp.google.com!news1.google.com!volia.net!news2.volia.net!feed-A.news.volia.net!news.ecp.fr!news.jacob-sparre.dk!munin.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: fyi, very interesting Ada paper OOP vs. Readability Date: Fri, 11 May 2012 19:37:25 -0500 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: munin.nbi.dk 1336783047 20729 69.95.181.76 (12 May 2012 00:37:27 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Sat, 12 May 2012 00:37:27 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Date: 2012-05-11T19:37:25-05:00 List-Id: "Simon Wright" wrote in message news:m2y5p0sfyg.fsf@pushface.org... > "Randy Brukardt" writes: > >> I tend to lean toward the explicit side of the fence (I try to avoid use >> clauses because of the maintenance headaches that they cause), but I do >> know >> that code can be too explicit. People hate it when I write: >> >> if Ada.Strings.Unbounded."="(My_String, >> Ada.Strings.Unbounded.To_Unbounded_String ("open") then ... >> >> because I refuse to use use clauses in almost all instances. I surely can >> see why they might not find the above as readable as: >> if My_String = "open" then ... > > Well, you live and learn! I thought the 'renaming To_Unbounded_String as > "+"' trick was necessary - should have trusted the designers. I use that trick (and "use all") when I have many operations to do in a scope, but if there is only one or two, it's not worth all of the typing. As for putting it in a package and importing and using it, recall the original message about making it hard to find declarations... Ada should have had a "conversion" operator ("#" has been proposed), and clearly Ada.Strings.Unbounded should use it. But that gets shot down every time it is proposed (and it has been proposed for every language revision other than Ada 2012); mainly because a minority think that "+" is perfectly good for that. And another minority think that uses "+" on non-numeric types is *disgusting*, so we can never get the operators added to packages. A perfect impasse. Randy. Randy.