Re: Consistent function names
| From: | Rasmus Lerdorf | Date: | Tue, 03 Mar 2015 00:03:19 +0000 |
| Subject: | Re: Consistent function names | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-84209@lists.php.net to get a copy of this message | ||
On 03/02/2015 03:54 PM, Yasuo Ohgaki wrote:
> Hi Markus, Larry and Rowan,
>
> On Tue, Mar 3, 2015 at 8:36 AM, Markus Fischer <markus@fischer.name> wrote:
>
>> On 03.03.15 00:10, Yasuo Ohgaki wrote:
>>> I would love to have new & clean APIs.
>>>
>>> Please think my proposal as legacy API cleanups. Many of candidates will
>>> remain
>>> without CORDING_STANDARSDS confirmed names almost forever. This is what
>>> I would like to improve. If you don't care about legacy stuff cleanups,
>>> please don't
>>> care. The cleanups will not hurt anything, almost.
>>
>> No ill intentions here, but adding the aliases and, as you propose,
>> literally adding *hundreds* of aliases is actually a mess to me.
>>
>> What you call "new & clean" is as a shield for effectively introducing
>> duplicates. You do not clean up anything that way. You leave a even
>> bigger mess behind. By going for your honorable goal of correcting
>> things I think you got lost in the woods.
>>
>> IMHO the only forward is to make sure new/future additions to the
>> language adhere to the coding standard or use a smart way (i.e. the
>> scalar addition).
>
>
> I think I understand your point very well.
> However, I have an urge impulse to add standard confirmed names
> when I see manual pages like
>
> http://php.net/manual/en/book.gettext.php
> bind_textdomain_codeset — Specify the character encoding in which the
> messages from the DOMAIN message catalog will be returned
> bindtextdomain — Sets the path for a domain
> dcgettext — Overrides the domain for a single lookup
> dcngettext — Plural version of dcgettext
> dgettext — Override the current domain
> dngettext — Plural version of dgettext
> gettext — Lookup a message in the current domain
> ngettext — Plural version of gettext
> textdomain — Sets the default domain
>
> This looks awful... just cannot put up with...
These come from the underlying libaries. You can type "man dcgettext" or
"man bind_textdomain_codeset" at your Linux command line and learn a lot
about how these work. Plus, if you are a C dev, much like strlen(),
these are simply the names you expect, or at least they are instantly
recognizable to you. As I normally explain to people, there is vertical
consistency here, not horizontal consistency.
I understand how people who don't have a background in the underlying
libraries might wish for a different API and horizontal consistency
across disparate extensions, but simply adding a bunch of aliases that
have no basis in anything doesn't help anybody.
-Rasmus
Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc
Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc