Rename std.string.toStringz?

Jonathan M Davis jmdavisProg at gmx.com
Thu Jun 16 13:32:44 PDT 2011


On 2011-06-16 12:16, Adam D. Ruppe wrote:
> Jonathan M Davis wrote:
> > stringz is neither a type nor a word.
> 
> It *is* a word. A stringz is a string that ends in zero. This
> family of traditional names (STRINGZ, ASCIZ, etc.) predates C itself.
> 
> On the other hand, there is *no such thing* as a StringZ. You'd
> never call it a "string zero". You'd call it a "zero terminated
> string", or maybe a "C string".
> 
> Changing it to "toCString" is completely pointless, a cost without
> a benefit, but at least it's not a completely nonsensical name like
> toStringZ.

Well, I'd argue that stringz is just as nonsensical as stringZ. I have _never_ 
heard the term stringz used outside of D. Searching for it online brings up 
_nothing_ (not even D). And I wouldn't really consider an identifier which is 
completely uppercase to necessarily say anything about where the beginning and 
end of a word is anyway, so I wouldn't really consider that much of a 
precedent. But it doesn't really matter.

What matters is whether we as a group think that renaming toStringz is 
worthwhile, and if so, what we name it to. _No one_ thus far has liked the 
name toStringZ, even if they agree that toStringz should be changed. They're 
pretty much all voting for toCString. So, there's no way that it's going to 
end up as toStringZ.

I'm going to let this thread go a bit longer before I decide what I'm going to 
do, but from the looks of it, we're not reaching any kind of consensus on 
this, and I'm not going to change toStringz unless we actually reach a 
consensus on the matter.

The discussions on fixing the function names in Phobos (and in particular, 
std.string) resulted in an almost unanimous decision to fix the function names 
in Phobos to be properly camelcased. So, in general, it's worth making those 
changes. However, this particular discussion about this particular function is 
anything but unanimous, so unless a greater agreement is reached than is 
currently happening, toStringz isn't going to be changed.

- Jonathan M Davis


More information about the Digitalmars-d mailing list