First Impressions
Kevin Bealer
kevinbealer at gmail.com
Mon Oct 2 23:35:52 PDT 2006
Georg Wrede wrote:
> Walter Bright wrote:
>> True, and some have called for renaming char to utf8. While that would
>> be technically more correct (as toUTF would be, too), it just looks
>> awful.
>
> Let's just say it would be a first step in lessening the confusion _we_
> create in newcomers' heads.
I would kind of agree with this, but I think it's a two-edged knife.
If we say 'char[]' then users don't know it's a string until they read
the 'why D arrays are great' page (which they should read, but...)
If we say 'string' then we hide the fact that [] can be applied and that
other array-like operations can work.
For instance, from a Java perspective:
char[] : Users don't know that it's "String"; users see it as low-level.
Some will try to write things like 'find()' by hand since they
will figure arrays are low level and not expect this to exist.
string : Users will think it's immutable, special; they will ask "how do
I get one of the characters out of a string", "how do I convert
string to char[]?", and other things that would be obvious
without the alias.
Kevin
More information about the Digitalmars-d
mailing list