Re: Resurrecting the Function Renaming Thread
| From: | Andrei Zmievski | Date: | Wed, 07 Feb 2001 17:56:31 +0000 |
| Subject: | Re: Resurrecting the Function Renaming Thread | ||
| References: | 1 2 3 4 5 6 | Groups: | php.qa |
| Request: | Send a blank email to php-qa+get-2298@lists.php.net to get a copy of this message | ||
On Wed, 07 Feb 2001, Cynic wrote:
> Well, it doesn't have to be that way. I'm sure that if I had
> to learn the "clean" version of PHP, it would take me maybe
> less than a third of a time compared to the real one.
> The difference? In one case you have to memorize the function
> names and their arguments, in the other you're set off with
> knowledge of a few principles and english.
>
> * I wouldn't have to memorize bin2hex() and bindec(), and wouldn't
> consistently put / omit the '2' in the wrong function.
> * I wouldn't have to memorize that explode() is different from
> strstr(). (Let me explain: implode is like strstr in that sense
> that it takes two arguments, which can be percieved as a haystack
> and a needle. You break the haystack on the needle. But if you
> look at it this way--which I, sorry me, do--you see the
> inconsistency.)
> * Lots of other things.
The way Python does it (which I kind of like) is by putting all related
functions into a module and then accessing them through that module,
e.g.:
string.uppercase()
string.lowercase()
string.find()
os.popen()
You get the idea. PHP will not be able to do that due to the lack of
namespace/module support, so the only resort is to use prefixes...
-Andrei
"Later in this talk, I intend to define
the universe and give three examples." -- Larry Wall