comp.lang.ada
 help / color / mirror / Atom feed
From: AdaMagica <christ-usch.grein@t-online.de>
Subject: Re: String_Holder ?
Date: Thu, 22 Dec 2011 03:40:27 -0800 (PST)
Date: 2011-12-22T03:40:27-08:00	[thread overview]
Message-ID: <0c99be6b-02b2-40c1-bf32-ed1a556c8e20@l19g2000yqc.googlegroups.com> (raw)
In-Reply-To: slrnjf5sqr.1lme.lithiumcat@sigil.instinctive.eu

On 22 Dez., 10:08, Natasha Kerensikova <lithium...@gmail.com> 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.



      parent reply	other threads:[~2011-12-22 11:46 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-18 12:34 String_Holder ? Natasha Kerensikova
2011-12-18 16:48 ` Brad Moore
2011-12-18 20:55 ` Jeffrey Carter
2011-12-18 23:08   ` Natasha Kerensikova
2011-12-19 12:14     ` Niklas Holsti
2011-12-19 11:12 ` Martin
2011-12-19 23:53 ` Randy Brukardt
2011-12-22  9:08   ` Natasha Kerensikova
2011-12-22 10:08     ` Niklas Holsti
2011-12-22 12:23       ` Simon Wright
2011-12-23  1:26       ` Randy Brukardt
2011-12-23  6:18         ` Jeffrey Carter
2011-12-22 11:40     ` AdaMagica [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox