RE: [PHP-QA] Resurrecting the Function Renaming Thread
| From: | Karl Austin | Date: | Wed, 07 Feb 2001 19:39:19 +0000 |
| Subject: | RE: [PHP-QA] Resurrecting the Function Renaming Thread | ||
| References: | 1 | Groups: | php.qa |
| Request: | Send a blank email to php-qa+get-2313@lists.php.net to get a copy of this message | ||
Your point about most on the list being C coders is very valid and should be
taken into consideration, if we move PHP to be more like C then it will lose
out in the end - C just isn't a language lay-users find easy, I know I have
participated in classes that have tought C++ (Started with C first) and I
know that the vast majority of people found it very difficult to pick up.
I know that the language should not alienate existing users, but without new
users the language will die, without new users the language will not spread,
without ease of use the language will not get to the masses.
As for the code snippet, I see it as perfectly logical, it looks fine to me.
Also of note is that how can people take the recomendations of PEAR
seriously when the language its self can't get a standard going.
As for str_addslashes or addslashes, I think that str_addslashes is better -
it is more readable, a new user would think, hmmm it obviously owrks on a
string, they don't have to worry to much about knowing what every function
does when they read other peoples code - I hope you know what I mean because
I have just done a bad job of describing it.
Karl
-----Original Message-----
From: Cynic [mailto:cynic@mail.cz]
Sent: 07 February 2001 18:19
To: Sterling Hughes; Karl Austin; Php-Qa Mailinglist; Andrei Zmievski
Subject: Re: [PHP-QA] Resurrecting the Function Renaming Thread
At 18:15 7.2. 2001, Sterling Hughes wrote the following:
--------------------------------------------------------------
><?php
>if (str_len($x) == 0) {
> echo "String length is 0";
>}
>echo str_len($foo);
>$bar = str_len($foo);
>?>
>
>Ugggghhhhhhhhh.
>
>I don't think any language should reccomend a syntax like that.
What's so wrong with it? I think it's ok. Note: I'm aware my POV
would be very likely much different if I had used C for a couple
of years. I'm not a C coder. While this disqualifies me in many
areas (and I regret it), it allows me to see that there are lots
of people who can't tell C from a haiku.
You know, the problem with this mailing list is that most of the
participants are PHP developers which means they're C coders. And
they're (you are :) obviously biased. That's not to imply anything
disregarding or what. But it might be interesting to ask the 'laymen'
in php-general or php-windows. I guess either side would be surprised:
either those in favor of renaming or the "C guardians". It might
turn out 8 out of 10 people don't know C, and don't give a damn if
strlen has been strlen in C since '60. Or I might realize that an
average PHP user is someone who's written hundreds of thousands of
C code. I don't know. My experience from a local PHPUG suggests
that the 8 to 2 rate is actually favoring the C coders.
>strlen() is fine, its a standard function that's been in PHP and is in
many
>languages. There's no reason to blindly start renaming PHP functions to
>conform to a naming standard. Ok, yes, fine, for some functions it does
>make sense, all mysql functions, should be and are prefixed with mysql_*.
>But in some cases it does. A function that tokenizes strings should be
>strtok()
why? what are the consequences with regard the language as a whole?
>a function that gets the length of a string should be strlen(). A
>function that add's slashes to a string should be addslashes not
>str_addslashes()
>
>which looks better:
>
>$str = AddSlashes($str);
>
>or
>
>$str = str_addslashes($str);
>
>???
IMO the latter.
>I'd say it would be best to leave php's basic functions alone
This might be a solution as well. I'm open to other opinions.
Define "basic function" then.
>(maybe one or two)...
I very strongly disagree. I even think that if the conclusion will
be leave str* as they are, I would raise the question of renaming
str_pad (and the other few str_* functions) to be changed to strpad
etc. There should be some logic. Whatever it is.
>And maybe look at the extensions which are mostly ns protected.
>
>-Sterling
Thanks for your input.
____________________________________________________________
Cynic:
A member of a group of ancient Greek philosophers who taught
that virtue constitutes happiness and that self control is
the essential part of virtue.
cynic@mail.cz
--
PHP Quality Assurance Mailing List <http://www.php.net/>
To unsubscribe, e-mail: php-qa-unsubscribe@lists.php.net
For additional commands, e-mail: php-qa-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net