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

[perl #131685] Rename utf8::is_utf8() (and other functions)

Thread Previous | Thread Next
Father Chrysostomos via RT
July 14, 2017 02:29
[perl #131685] Rename utf8::is_utf8() (and other functions)
Message ID:
On Wed, 12 Jul 2017 21:55:03 -0700, wrote:
> I guess we have a fundamental disagreement about language design and
> the
> direction Perl should go, which makes me sad.

I agree the disagreement is unfortunate.

> The point of adding synonyms for deceptively-named functions and
> macros
> is to make life easier overall.  Forbidding new better-named synonyms
> for problematically named things forces everyone who comes along to
> deal
> with the gotchas and cognitive load that those people already here
> have
> had to deal with.  By creating better named things, those people can
> largely avoid these problems.  This allows them to work more
> efficiently, avoiding traps, and with less cursing Perl.

When you first put forward this argument (specifically with regard to av_len), it made sense to me, and I had no objection to it.  Later, people wrote to p5p complaining that the new situation was more confusing; in addition, *I* started to get confused.  That was when I started to have second thoughts.

I think Damian Conway was right when he wrote in PBP that one should not use English (the module).  Since other people use punctuation variables, you are going to have to learn them anyway.  Using the English names just forces others reading your code to look up the names that you are using.  It just creates more cognitive burden.

I think the same applies even to poorly named functions.  You just have to learn the gotcha once, and then you can use the function and read code that uses it.  (And if you use functions without reading either the documentation or the source, then you are coming close to what I would call autopodotoxy.)

> Unless Perl is close to death, the number of people who are going to
> come along before it does die dwarfs the number who are already
> expert.
>    Some people are knowledgeable in parts of Perl, but not all.  They
> also gain if gotchas get removed before they have to deal with them.

But the gotchas never get removed.  You just end up with a larger pile of functions for people to sift through.  Not to mention a lot of existing (and correct) code that they cannot read without learning the discouraged parlance.  So they have to learn the different forms anyway.

My personal experience is that what you are arguing for, while it sounds good, does not work in practice.


Father Chrysostomos

via perlbug:  queue: perl5 status: open

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