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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,c6aaff9993e444f0 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.74.201 with SMTP id w9mr7777441pbv.0.1324554363989; Thu, 22 Dec 2011 03:46:03 -0800 (PST) Path: lh20ni51468pbb.0!nntp.google.com!news1.google.com!postnews.google.com!l19g2000yqc.googlegroups.com!not-for-mail From: AdaMagica Newsgroups: comp.lang.ada Subject: Re: String_Holder ? Date: Thu, 22 Dec 2011 03:40:27 -0800 (PST) Organization: http://groups.google.com Message-ID: <0c99be6b-02b2-40c1-bf32-ed1a556c8e20@l19g2000yqc.googlegroups.com> References: NNTP-Posting-Host: 80.156.44.178 Mime-Version: 1.0 X-Trace: posting.google.com 1324554363 28264 127.0.0.1 (22 Dec 2011 11:46:03 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 22 Dec 2011 11:46:03 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: l19g2000yqc.googlegroups.com; posting-host=80.156.44.178; posting-account=rmHyLAoAAADSQmMWJF0a_815Fdd96RDf User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-Header-Order: HUALESRCNK X-HTTP-UserAgent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20100101 Firefox/8.0,gzip(gfe) Content-Type: text/plain; charset=ISO-8859-1 Date: 2011-12-22T03:40:27-08:00 List-Id: On 22 Dez., 10:08, Natasha Kerensikova wrote: > Even though they can all be implementation with Unbounded_String under > the hood, the more specific type allows better self-documentation of the > code, and hides Unbounded_String operations that are not natural for the > given function (e.g. String_Holder is supposed to reference an immutable > string, so any operation that change the underlying Unbounded_String > would break stuff). OK, so write your spec and implement it with Unbounded_String. That would be a good solution of your problem. > > So I don't understand the point -- and you clearly need a reason to write a > > new package here rather than using the built-in one. > > Do I really need a reason? I tend to consider a 20-line specification > and a 30-line package body as something extremely cheap. Am I missing > something in my cost evaluation? No, that's not extremely cheap (if the body is not implemented with some other proven code which in this case this would most probably be mostly renames). You forget about unit testing, documentation, formal qualification testing, releasing the software to the customer, and so on. Any line of code you write unnecessarily adds to the costs of the whole life cycle of your code.