develooper Front page | perl.perl5.porters | Postings from February 2017

Re: Proposal: Rename utf8::is_utf8() to utf8::is_upgraded()

Thread Previous | Thread Next
Karl Williamson
February 26, 2017 06:10
Re: Proposal: Rename utf8::is_utf8() to utf8::is_upgraded()
Message ID:
On 02/19/2017 11:41 AM, Father Chrysostomos wrote:
> Karl Williamson wrote:
>> I think it is a good idea to at least give people an opportunity to have
>> a name that doesn't mislead, even if we keep the old name for back
>> compatibility.  I've done that several times in the core.  The problem
>> with a misleading name is that it, well, misleads.  Even if you know
>> about it, in skimming code, you can be misled.
> But in the end having four different ways to write AvFILL is more con-
> fusing than the situation we started with.  (And av_tindex does not
> seem at all an intuitive name to me.)

The first things I created synonyms for, IIRC were isALNUM and isALNUMC, 
and their derivatives.  I remain convinced this was a good idea.

I looked back over the emails concerning av_tindex and av_top_index. 
These were designed to replace av_len, which already was a synonym for 
AvFILL and AvFILLp.  av_len was clearly misnamed.  It did not correspond 
to sv_len.  There were no complaints about av_tindex at the time, though 
comments were requested, so it went in.  It is for us aural learners who 
pronounce internally what we read.
>> So, I support adding a synonym.
> I do not.  The main reasons for using the function are to work around
> problems with buggy XS modules.  Adding a synonym for a function that
> most correct code should not be using seems like the wrong direction
> to be going in.

I don't think your argument makes sense here.  Having a name that 
clearly indicates what the function does will decrease the likelihood of 
someone using it in situations where it isn't warranted, which is what 
we want.

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About