Stanislav Malyshev wrote:
> RC>> It's more legible for the same reason that it's easier (and
> RC>> faster) to read "one two three" than "onetwothree". The human
> RC>> mind can easily tokenize at the appropriate places, when it has
> RC>> a token. Without a token, the string is much harder to parse.
> For me, "isalpha" is single token. That's the name, much like Johnson or
> Chandrabharmata.
That makes sense to me. To a newbie, that's a lot of proper names to learn,
rather than learning a generic grammar, which they can then re-use.
<shrug>
> I repeat it once more, to be clear:
> ========
> Functions that have "well known" names should not be touched.
> Snip_>
Well, then defining "well known" may also become an issue. Well known by
whom? C programmers? Perl Hackers? Java users? The users of a particular
PHP module?
I'm of the belief that parallel function names to C, Perl, etc. are good
for convenience, IF AND ONLY IF functionality is the same. See PHP "chop()"
for why doing otherwise is a bad thing... PHP chop() behaves rather oddly
as far as most Perl folks are concerned. Is it a well known name? Yes.
Does it work in a well known fashion? Not if you use Perl. Does it need to
be renamed? (I have no good answer for this one.) How about read()? (same
kind of issue.)
> RC>> I didn't check a manual. Ldap functions aren't named in a mixed fashion
> RC>> of word_wordword and word_word_word. They follow the *most common* PHP
> RC>> syntax of using word_word_word.
> Don't try to make me believe you remember all the "non-underscore" part of
> all functions by hard and your only problem is knowing where's the
> underscore.
The most common function names I remember by their words, but
without looking at a manual. When do i need to use *_num_rows,
*numrows, or *_num_rows?
Do you honestly know, from the words, what it does? Are you familiar
with num rows?
How about the num rows command for MySQL? PostgreSQL? Informix? Sybase?
mSQL? MSSQL? Are all of the num rows commands the same? (no.)
How about num fields? Are all of them the same?
Why on earth should you have to reference a manual for this *simple
task* of figuring out if it's supposed to be numrows, or num_rows?
> RC>> To stop confusing the *language*, as a whole, we should be doing this with
> RC>> some consistency, so we're not confusing people as they try to learn new
> RC>> function names.
> That's not "confusing". That's "remaining in touch with the rest of the
> known world". I do not want function to open file be
> "filesystem_open_file". I want my old trusty fopen. It served me well for
> years.
Well, I don't believe in making it impossible to type. Heck, if it means that
much to any of us, we _can_ just alias the function names ourselves. I
personally (also) consider fopen as one word, and would miss the ability to
have or use convenience aliases (which is something I put into a spec a
long time ago, but it caused *another* round of debate, as it might inspire
folks to create all sorts of bad function names. :-) ).
I'm not focusing on making life harder for coders who have seen languages
come and go, who are used to syntax and keywords being deprecated or reserved.
I'm focusing on making life easier for the newbies, and I thank you,
Stas, for some of the good reminders about maintaining legacy codebase.
(No sarcasm intended.)
-Ron
--
--2D426F70|759328624|00101101010000100110111101110000
Personal: [EMAIL PROTECTED], 520-326-6109, http://www.opus1.com/ron/
Work: [EMAIL PROTECTED], 520-546-8993, http://www.pnsinc.com/
The opinions expressed in this email are not necessarily those of myself,
my employers, or any of the other little voices in my head.
--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]