comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Question on bounded / unbounded strings
Date: Thu, 22 Sep 2016 09:24:24 +0200
Date: 2016-09-22T09:24:24+02:00	[thread overview]
Message-ID: <ns010s$1s8h$1@gioia.aioe.org> (raw)
In-Reply-To: 11ee98f5-d373-4c72-8562-c310cc76817d@googlegroups.com

On 22/09/2016 04:10, John Smith wrote:

> Why would you say this?

Because it is truth? (:-))

> I've found the ease with which you can append or manipulate unbounded
> strings to be very convenient.

1. There is no need to append to a string in no less than 90% of cases.

2. Unbounded_String manipulations are *very* inconvenient. Largely 
because of their design flaw in Ada (no array interface), but nonetheless.

> Furthermore, I don't need to worry about
> computing the bound of my string.

Neither do I, I never ever used bounded strings. They are totally 
useless, IMO.

> But I genuinely am curious about your view on this and why.

As I said in 90% cases the string is given, it is an input. All strings 
derived from the input strings are substrings (or their derivatives).

The use cases like tokenizing are virtually non-existent, they are just 
bad programming practices coming from scripting languages which have no 
decent support of string characters iteration and from languages 
incapable to return strings as a result of function call.

As for 10% when strings are output, e.g. string formatting, unbounded 
strings are no more usable. The output length is usually fixed 
consisting out of fields. The substrings are aligned in the fields. It 
is far easier with plain strings and substrings.

The idea of using Unbounded_String as an accumulator, e.g. for some 
messages log, is just awful. It won't work and at the end you will need 
to have a special data structure (text buffer) for this (with plain 
strings as building blocks).

My method of string processing is sequential scanning / putting fields into:

http://www.dmitry-kazakov.de/ada/strings_edit.htm

Plain strings are ideal for this.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de


  reply	other threads:[~2016-09-22  7:24 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-13  8:46 Question on bounded / unbounded strings Arie van Wingerden
2016-09-13  9:04 ` Dmitry A. Kazakov
2016-09-22  2:10   ` John Smith
2016-09-22  7:24     ` Dmitry A. Kazakov [this message]
2016-09-22  9:01       ` J-P. Rosen
2016-09-22  9:53         ` Dmitry A. Kazakov
2016-09-22 10:58           ` G.B.
2016-09-22 12:05             ` Dmitry A. Kazakov
2016-09-22 14:14               ` G.B.
2016-09-22 17:18                 ` Dmitry A. Kazakov
2016-09-22 11:08           ` J-P. Rosen
2016-09-22 12:05             ` Dmitry A. Kazakov
2016-09-22 13:18           ` Maciej Sobczak
2016-09-22 13:52             ` Dmitry A. Kazakov
2016-09-22 14:51               ` Maciej Sobczak
2016-09-22 17:13                 ` Dmitry A. Kazakov
2016-09-23  5:50                   ` Maciej Sobczak
2016-09-23  6:36                     ` Simon Wright
2016-09-23  7:48                       ` Dmitry A. Kazakov
2016-09-28 20:55                     ` Randy Brukardt
2016-09-23 23:58       ` John Smith
2016-09-24  7:52         ` Dmitry A. Kazakov
2016-09-24 16:25           ` John Smith
2016-09-24 17:44             ` Dmitry A. Kazakov
2016-09-24 18:33               ` John Smith
2016-09-24 18:37               ` John Smith
2016-09-24 18:59               ` John Smith
2016-09-25  8:50                 ` Dmitry A. Kazakov
2016-09-25 23:35                   ` brbarkstrom
2016-09-26  7:28                     ` Dmitry A. Kazakov
2016-09-26 12:39                       ` brbarkstrom
2016-09-28 21:09             ` Randy Brukardt
2016-09-30  7:59               ` Björn Lundin
2016-09-13  9:35 ` gautier_niouzes
2016-09-13 10:41 ` Alejandro R. Mosteo
2016-09-13 17:41 ` Jeffrey R. Carter
2016-09-13 17:59 ` Björn Lundin
2016-09-14 11:23 ` Arie van Wingerden
2016-09-14 12:26   ` Arie van Wingerden
2016-09-14 12:28   ` Arie van Wingerden
2016-09-14 12:57 ` Arie van Wingerden
2016-09-14 19:39   ` Jeffrey R. Carter
2016-09-17 16:35     ` Arie van Wingerden
2016-09-16 14:43 ` Olivier Henley
2016-09-17 16:35   ` Arie van Wingerden
replies disabled

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