Rename std.string.toStringz?

Jonathan M Davis jmdavisProg at gmx.com
Thu Jun 16 09:02:50 PDT 2011


On 2011-06-16 07:33, Steven Schveighoffer wrote:
> On Thu, 16 Jun 2011 04:47:50 -0400, Dejan Lekic
> 
> <dejan.lekic at tiscali.co.uk> wrote:
> > I am against the change for ... social reasons.
> > 
> > Simply put, the D community is used to toStringz . I might be wrong, but
> > I think we are all familiar with this function and use it on a daily
> > basis. :)
> 
> I agree with this assessment.  I'll add that toStringz is memorable -- I
> remember how to use it and write it instantly.  I'm not sure why, but I
> think it's because it's name is really unlikely to occur in any other
> context.
> 
> I don't agree that toStringz is incorrectly camel cased

I'm afraid that I don't understand this view at all, given that string is a 
word and stringz isn't, though there are a few people that have expressed this 
view now.

> and I think
> toCString is not as descriptive, because it's identifying the language
> where zero-terminated strings are from, not that the string is zero
> terminated (signified well by the zero).
> 
> I would like to change toUTF16z to toWStringz (and likewise for
> dstrings).  You haven't listed this as an option.  I see a large
> inconsistency there.

Well, my concern at this point is really toStringz, not toUTF16z. If toStringz 
is renamed, then toUTF16z should follow suit. If it isn't, then perhaps 
toUTF16z should still be renamed, but my pull request doesn't do much with 
std.utf, so messing with toUTF16z isn't really the goal. It's just a side 
effect of renaming toStringz. So, if we keep toStringz, we may very well still 
rename toUTF16z, but the real question is whether we want to rename toStringz.

- Jonathan M Davis


More information about the Digitalmars-d mailing list