Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

naming of the Str type

6 views
Skip to first unread message

Darren Duncan

unread,
Aug 8, 2006, 8:25:55 PM8/8/06
to perl6-l...@perl.org
This may be a non-problem in practice, but ...

Regarding the Str data type, which Perl 6 defines as holding a
compact sequence of characters, I'm thinking that this type's current
name is ambiguous considering the traditional uses of the word.

Traditionally, a "string" isn't necessarily a sequence of characters,
but could also be a sequence of octets or bits or other things. A
lot of programmers can see the word "string" and think of that term
in its more broad sense.

I'm wondering if it would not be inappropriate to change the name Str
to something more descriptive of its content within the historical or
current wider context.

For example, would the name Text be any worse? In my mind, that is
less ambiguous and specifies a string of characters rather than a
string of bytes.

Moreover, the general public better understands the meaning of the
word Text than string, which could help in some small way to bringing
new people to the language. (And Perl 6 is meant to be more
ideomatic like human languages, within reason, is it not?)

Of course, "Character String" or "Char Str" or "Char Data" would also
be unambiguous, but that is two words, and all our built-in types are
composed of 1 word. Also, I discount "Char" as an option, because
while it speaks characters, it is ambiguous as to whether it is
exactly 1 character or a string of such. So "Text" seemed to be the
best compromise.

So, stepping aside from any "it ain't broke" arguments in the favor
of Str, is there anything about the name Text that makes it a worse
or better candidate in regards to specificity or ambiguity in your
mind?

Or alternately, are there any other names which might work better
than Str for specifying character data?

-- Darren Duncan

Darren Duncan

unread,
Aug 9, 2006, 1:43:23 AM8/9/06
to perl6-l...@perl.org
At 5:25 PM -0700 8/8/06, Darren Duncan wrote:
<snip>

>I'm wondering if it would not be inappropriate to change the name
>Str to something more descriptive of its content within the
>historical or current wider context.
>
>For example, would the name Text be any worse? In my mind, that is
>less ambiguous and specifies a string of characters rather than a
>string of bytes.
<snip>

Following a discussion on #perl6 just now with several people, ...

http://colabti.de/irclogger/irclogger_log/perl6?date=2006-08-09,Wed&sel=170#l307

... I have evolved my thoughts to accept that Str is a good-enough
name for something that is strictly defined as a sequence of unicode
characters, and won't continue to recommend strongly that it be
renamed to something else like Text.

This isn't to say that I actually disagree with my proposal, but
rather that the momentum in the industry has a majority using the
name "string" for character sequences, and it isn't actually terrible.

So I'll drop this matter and attend to frying other fish instead.

Good day. -- Darren Duncan

David Green

unread,
Aug 13, 2006, 12:35:03 PM8/13/06
to perl6-l...@perl.org
On 8/8/06, Darren Duncan wrote:
>At 5:25 PM -0700 8/8/06, Darren Duncan wrote:
><snip>
>>I'm wondering if it would not be inappropriate to change the name
>>Str to something more descriptive of its content within the
>>historical or current wider context.
><snip>

>... I have evolved my thoughts to accept that Str is a good-enough
>name for something that is strictly defined as a sequence of unicode
>characters, and won't continue to recommend strongly that it be
>renamed to something else like Text.

I thought your reasons made sense, and would be happy with a "Text"
type, although I don't especially object to "Str" -- as you say, it's
probably good enough given ordinary programming usage.

However the IRC excerpt contained some comments about not conflating
or confusing "Str" with "strings". To me, that would mean they
*should* have different names. If there's a distinction worth
making, then it's worth using distinct terminology, and "Str" vs.
"string" isn't distinct enough: you can tell people they're not
really the same thing, but they ain't gonna believe you.
There's nothing else "Str" could reasonably mean other than "string"
(just as I don't think "regex" can very reasonably mean anything
other than "regular expression").


-David

Darren Duncan

unread,
Aug 13, 2006, 10:09:30 PM8/13/06
to perl6-l...@perl.org
At 10:35 AM -0600 8/13/06, David Green wrote:
>On 8/8/06, Darren Duncan wrote:
>><snip>

>
>I thought your reasons made sense, and would be happy with a "Text"
>type, although I don't especially object to "Str" -- as you say,
>it's probably good enough given ordinary programming usage.
>
>However the IRC excerpt contained some comments about not conflating
>or confusing "Str" with "strings". To me, that would mean they
>*should* have different names. If there's a distinction worth
>making, then it's worth using distinct terminology, and "Str" vs.
>"string" isn't distinct enough: you can tell people they're not
>really the same thing, but they ain't gonna believe you.
>There's nothing else "Str" could reasonably mean other than "string"
>(just as I don't think "regex" can very reasonably mean anything
>other than "regular expression").

Yes. And I agree that "Str" doesn't reasonably mean anything other
than "string". My conclusion is that, given the context, I am
satisfied with either "Text" or "Str" for the sequence of unicode
characters.

While the issue could be revisited if enough other people prefer
"Text", I decided (and announced) that I would focus my energies on
pressing matters I found more important (frying bigger fish).

It's related to a principle of "crying wolf". If I keep pressing for
every little thing to go my way, people won't want to listen when I
raise more important issues.

An example that I did continue to press after initial indifference
(or opposition) was a 'Blob' type addition, which ended up happening
(thank you again, Larry). Other examples are ongoing, as I work to
build a better case before re-raising them.

And besides, I have on several occasions raised suggestions where I
was subsequently convinced that my proposal was wrong / would have
made things worse. Eg, I once proposed that an undefined variable
should never auto-vivify to a defined value, needing instead an
explicit real value assignment, and suggested certain behaviour
changes relative to Perl 5 on what should happen if you attempt to
use an undefined value as a defined one (various types of failure).
I later realized that this proposal would have made things worse in
several ways, and in fact I would now oppose such a change, as
unlikely as that is to be proposed.

But if you think more strongly about a 'Str' name change, good luck
in raising a better case for it.

-- Darren Duncan

0 new messages