www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Re: Rename std.string.toStringz?

reply Paul D. Anderson <paul.d.removethis.anderson comcast.andthis.net> writes:
Jonathan M Davis Wrote:

 
 1. Keep toStringz as it is (as well as toUTF16z) and either consider stringz 
 to be some sort of word unique to the D community or just admit that we're not 
 going to camelcase it because it would break too much code to do so.
 

vote++. 1) If it ain't broke, don't fix it. Too much disruption for too little gain. 2) In a language that uses "enum" to mean "manifest constant", worrying about an upper or lower case z is straining at a gnat and swallowing a camel. Paul
Jun 16 2011
next sibling parent "Lars T. Kyllingstad" <public kyllingen.NOSPAMnet> writes:
On Thu, 16 Jun 2011 13:44:07 -0400, Paul D. Anderson wrote:

 2) In a language that uses "enum" to mean "manifest constant", worrying
 about an upper or lower case z is straining at a gnat and swallowing a
 camel.

:D
Jun 16 2011
prev sibling next sibling parent "Jonathan M Davis" <jmdavisProg gmx.com> writes:
On 2011-06-16 10:44, Paul D. Anderson wrote:
 Jonathan M Davis Wrote:
 1. Keep toStringz as it is (as well as toUTF16z) and either consider
 stringz to be some sort of word unique to the D community or just admit
 that we're not going to camelcase it because it would break too much
 code to do so.

vote++. 1) If it ain't broke, don't fix it. Too much disruption for too little gain. 2) In a language that uses "enum" to mean "manifest constant", worrying about an upper or lower case z is straining at a gnat and swallowing a camel.

It has been made pretty clear in discussions in this group before that in the general case, the consensus is that we want Phobos' function names to consistently follow Phobos' naming conventions (which means camelcased starting with a lowercase letter in the case of functions), even if it means breaking code in the short run in order to fix it. So, following that, if toStringz isn't properly camelcased (and I really don't understand anyone who thinks that it is), then it should be renamed. Whether it's the biggest problem in the language or library or not is irrelevant. Based on past discussions in this group, one would think that most people would want toStringz to be changed to be properly camelcased. However, it _is_ a function which is used a _lot_ and changing it will break a lot of code, so if we change the name, it needs to be worth doing so. I'm just trying to find out if the community at large thinks that it's worth changing toStringz to be properly camelcased given the cost, and if so, whether it's best to just camelcase it properly (toStringZ) or to rename it entirely. It's clear that in the general case, the community believes that it's worth it. The question is whether they believe that it's worth it in this particular case. I don't find whether there are other, bigger issues in the language or library to be particularly relevant unless they affect this particular issue. - Jonathan M Davis
Jun 16 2011
prev sibling parent Andrej Mitrovic <andrej.mitrovich gmail.com> writes:
It would be cool if with each release we distributed a tool that can
at least do partial renaming of old function names to new ones. This
should ease porting a codebase to a new version of DMD/Phobos. Think
about how Python has the 2to3 tool, except our tool might just do a
minimal search & replace between two small versions.
Jun 16 2011