perlancar / perl-Getopt-Long-More

1 stars 1 forks source link

Mure stuff: Deprecate `handler`, then long live `destination` #21

Closed tabulon closed 4 years ago

tabulon commented 5 years ago

The WHAT

Deprecate the term handler in favor of the term destination.

This includes all mention in documentation, parameter/attribute names, as well as in the source code; except what is strictly needed for documenting and handling the deprecation itself.

The deprecation cycle should last no more than 1 year; considering the current estimate of relatively low number of GLM users.

The WHY

At this time, Getopt::Long (GoL) documentation just talks about destination to refer to pretty much the same thing as GLM's handler.

Since Getopt::Long::More (GLM) aims and claims to be a fully compatible drop-in replacement for GoL, it's only normal that it would employ the same names that GoL uses for the same things --if, of course, those really are the same things; which happen to be the case here.

Also, the term destination has the advantage of having been around at least since the 1970s, without evolving much in its semi-ambiguous (but well established) conventional meaning of "where stuff ends up", which is exactly the concept sought here.

Apart from the points raised above, the term handler is probably not that suitable in any case, since it is usually understood to only denote CODE; whereas in this case, destination could be just about any kind of reference (SCALAR, ARRAY, HASH, and God knows what else, in addition to CODE).

So, in a little while, we'll hopefully be able to shout :

handleris deprecated, long live destination!

For current users of GLM, that may come to be a bit awkward, at first; and for those who have been using only for CODE, it might just sound simply outrageous; but later on, things should settle just fine.


About "MURE STUFF"

This is hopefully one of the rare Mure stuff series (Note the "u" :-).

Mure stuff are NOT [More stuff], in the sense that they won't be bringing new features / added value, at least in the immediate outset.

Instead, Mure stuff are basically stuff that we want to somehow come back to; in order to harmonize / reorganize/ rationalize / limit / ...

When you set out for that kind of thing, you often end up renaming and/or deprecating stuff as well...

So, in general, it's not that much fun to deal with Mure stuff, but sometimes, "you gotta do what you gotta do".


See the wiki for "more" on Mure stuff, where you will also find some "fun read" as well.


perlancar commented 4 years ago

I'm marking #21 as closed (all merged)