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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,4da4573d129f824a X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-01-09 08:10:48 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newshosting.com!news-xfer1.atl.newshosting.com!small1.nntp.aus1.giganews.com!border3.nntp.aus1.giganews.com!intern1.nntp.aus1.giganews.com!nntp.giganews.com!nntp.comcast.com!news.comcast.com.POSTED!not-for-mail NNTP-Posting-Date: Fri, 09 Jan 2004 10:10:47 -0600 Date: Fri, 09 Jan 2004 11:10:46 -0500 From: "Robert I. Eachus" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: style Q: type .. is new String; References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: NNTP-Posting-Host: 24.34.214.193 X-Trace: sv3-IvCPeenh5zru0EHsjDxwz2u5zBltRT6ZJfgHyrwE9cZJjz9EkTZ64OU7MlOdj6LHTTipu2RwTkjl05f!9nwhpB/uaqn2CT0i74U//2IonmdXOonKX4iBCQlZgs1NZi61l1wjRgGMUs2lgg== X-Complaints-To: abuse@comcast.net X-DMCA-Complaints-To: dmca@comcast.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.1 Xref: archiver1.google.com comp.lang.ada:4258 Date: 2004-01-09T11:10:46-05:00 List-Id: 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