Re: Direction for the Function Renaming Effort
| From: | Phil Driscoll | Date: | Fri, 09 Feb 2001 09:41:07 +0000 |
| Subject: | Re: Direction for the Function Renaming Effort | ||
| Groups: | php.qa | ||
| Request: | Send a blank email to php-qa+get-2367@lists.php.net to get a copy of this message | ||
Zeev and Richard wrote:
>'and' and '&&' are not the same thing, and 'or' and
>'||' are also
different...
<OT a bit>
I know - but 15 years of ARM assembler programming has taught me the beauty
of minimalism. With sensible use of brackets, they are the same, the code is
more readable (IMHO!), and a novice programmer has a chance of working out
what's going on.
</OT a bit>
Again, just to reiterate, I don't want to break any code at all, I would
like to see PHP able to run all (or maybe 99.9% of all) current scripts
without problems.
Also, I'm certainly not moaning at all. PHP is currently a fantastic tool -
it hits the spot very well indeed, and I love using it. But, as we all know,
it can be improved. Users may not be complaining loudly (or indeed at all)
which is fair enough. Most of them have just discovered a new tool which
does the job far better than anything else they've ever used before - hardly
something to moan about!
It would be nice in ten years time to be able to look back and be glad that
in 2001 he had 'vision' to tidy things up. Carrying baggage only gets worse
as time goes on - ask MS or Intel.
Rather than tidying up around the edges, I urge everyone to consider a
proper spring clean. Methods such as a php.ini switch, or a call to
i_want_to_run_in_clean_mode_please() (or a more sophisticated and future
proof version based switch) can enable the new cleaner world and whatever
warning messages etc are required.
The minimum I would like to see done is:
Consistent sensible names for all functions.
Aliases to the above for 'well known' function names (eg standard C stuff so
that we can use strcmp as well as string_compare or whatever)
Consistent argument order for all functions
Then, while the drains are up, we might also consider:
Taking a close look at the language for duplicate implementations of the
same functionality (eg &&/and) and where appropriate, stripping out
unnecessary duplication.
Taking a close look at what certain functions do, and if they should do
something different then 'make it so'. (My favourite bugbear in this
category is empty() - because it returns true for a string containing '0'
somehow I can never use the function. Maybe it's useful in a context I have
never come across yet, but if not, it should be changed. I'm sure everyone
has a list of things they think should work slightly differently)
Other stuff which bugs other people!
I know that there is never a good time to do this kind of stuff, but if we
don't evolve we become extinct.
Cheers
--
Phil Driscoll
Dial Solutions
+44 (0)113 294 5112
http://www.dialsolutions.com
http://www.dtonline.org