Re: Resurrecting the Function Renaming Thread

From: Date: Fri, 26 Jan 2001 18:26:37 +0000
Subject: Re: Resurrecting the Function Renaming Thread
References: 1  Groups: php.qa 
Request: Send a blank email to php-qa+get-2184@lists.php.net to get a copy of this message
Here is my suggestion for how we should do this. This plan is quite similar to plans proposed by several other people - notably: Ron Chmara, Richard Lynch and James Moore (and quite possibly several others) - however, it is different enough to merit posting (IMHO) :) Suggested Function Renaming Process =================================== Find bad function names. Choose conforming aliases. Notify the users that a major change is occuring - highlight the upcoming change in the release notes for every version released. Rename functions with bad names. Update the function prototype, etc... Implement the deprecated aliases using a PHP_DEPRECATED_FALIAS macro - initially, the macro will behave just as PHP_FALIAS. Change the documentation. **Note: Source code changes should be concurrent with the documentation updates.** Wait til the next *major* release (i.e. PHP 5) Remove the aliases from the documentation. Change the behavior of PHP_DEPRECATED_FALIAS so that a warning level error is thrown when an alias is used. Notify the users that old function names will be disabled in the next major release - highlight the upcoming change in the release notes for every version released. Wait til the next major release (i.e. PHP 6) Remove the aliases from the code before the initial release. To prevent this from happening again, we should review function names for modules before they enter the main distribution. If some bad names to slip past us, we correct them asap and provide no alias to the bad name. Early adopters of the function are likely to be able to deal with this. As long as having a lot of function aliases will not significantly hurt performance, I feel that this is the best approach. - Old scripts will continue to function for a long time. Users will have *years* of warnings before they are absolutely forced to rewrite scripts. - The approach is simple to implement. **Warning IANACP ;) - this solution may have to be implemented via something other than a macro and may not be as simple as I think.** Will some users continue to use the deprecated aliases? Absolutely - and they will squeal like little piggies when their scripts break. However, they will have had years of advance notice. Also, no one is forcing them to upgrade. Point in case: There are still people running PHP 2 and Perl 4... Also, providing scripts (or even a PHP function) that report old function names and/or update old names to new names (and alias/report conflicting user functions) should not be too challenging. --zak

« previous php.qa (#2184) next »