Rename std.string.toStringz?

Mafi mafi at example.org
Thu Jun 16 08:25:31 PDT 2011


Am 16.06.2011 16:33, schrieb Steven Schveighoffer:
> 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, 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.
I completely agree!

>
> -Steve

I think stringz is a name as itself and then having a camel-cased 
toStringX is correct IMO.


More information about the Digitalmars-d mailing list