comp.lang.ada
 help / color / mirror / Atom feed
From: "Robert I. Eachus" <rieachus@comcast.net>
Subject: Re: style Q: type .. is new String;
Date: Fri, 09 Jan 2004 11:10:46 -0500
Date: 2004-01-09T11:10:46-05:00	[thread overview]
Message-ID: <OeGdnQf9Fc8aT2OiRVn-vg@comcast.com> (raw)
In-Reply-To: <damLb.1900$I06.12540@attbi_s01>

tmoran@acm.org wrote:

> Though I create new types regularly for numeric variables, I've only
> rarely used other than the standard String type.  That saves doing type
> conversions, but it would be nice to have strong type checking help me
> detect errors.  Do other folks use new String types a lot and find it
> works out well?

No.  But my reason is different.  I use Bounded_String a lot in database 
type applications, where it is very appropriate.  (The database has a 
limit on the size of say, a Name, or a Street_Address, etc.)

In that context, it makes a lot of sense to have a different 
Bounded_String type for each field in the database, whether or not the 
fields actually have the same length.

Incidently, though, I don't usually make the Bounded_String instances 
private.  That way, when it does come time to actually display the 
results of a query, there is no need to have wrappers for the various 
Bounded_String to String conversion functions.


-- 
                                           Robert I. Eachus

"The war on terror is a different kind of war, waged capture by capture, 
cell by cell, and victory by victory. Our security is assured by our 
perseverance and by our sure belief in the success of liberty." -- 
George W. Bush




  parent reply	other threads:[~2004-01-09 16:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-09  0:00 style Q: type .. is new String; tmoran
2004-01-09  2:31 ` Stephen Leake
2004-01-09  2:58 ` Robert A Duff
2004-01-09 16:10 ` Robert I. Eachus [this message]
  -- strict thread matches above, loose matches on Subject: below --
2004-01-09 17:17 amado.alves
     [not found] <468D78E4EE5C6A4093A4C00F29DF513D04B82B19@VS2.hdi.tvcabo>
2004-01-09 17:34 ` Duncan Sands
2004-01-09 18:17 amado.alves
replies disabled

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