interesting article
Posted: Sun Apr 27, 2003 5:19 am
(warning, it does nothing but bash php
)
http://n3dst4.com/articles/phpannoyances/
Anyone have any responces to his opinions? I'd love to hear them...
http://n3dst4.com/articles/phpannoyances/
the article wrote: PHP Annoyances
Disclaimer: I've written a fair whack of PHP now and having a background of Java, C and (most importantly) Perl, I feel justified having a bit of a rant. If I've got the wrong end of the stick on anything, or if I've got the wrong stick entirely let me know! Likewise, feel free to inform me of other irksome issues I haven't bumped into yet. I do basically like PHP, but I wish these things weren't true:
1. No real references or pointers, just reference-by-name and sort-of aliases. Sometimes, I want a pointer.
2. No idea of namespace. Except maybe for classes, but even then the class definitions aren't namespaced. There isn't even a recommended way to name your classes to avoid hassle.
3. No componentization unless you kluge it yourself.
4. Desperately wants to be Perl, but desperately doesn't want to be Perl.
5. No standard DB interface (well, except ODBC, but blech)
6. All PHP community websites are written for non-programmer weinies. The whole thing seems oriented towards gimboids who can't understand the slightest bit of theory and have to be shown 'how to write a calendar' instead of 'how to use date arithmetic and come up with your own bloody answer'.
7. No chained method calls. Please, someone tell me I'm wrong on this, but I couldn't make PHP understand $foo->bar()->baz(). And not only that, but no discussion of the subject, anywhere. Too confusing for your average PHP user I suppose.
8. No globals except by importation - that's a side-effect of "no namespace protection".
9. register_globals used to bite. At least it's now $_REQUEST, but that bites too. What's wrong with named arguments?
10. Arrays are hashes.
11. PHP works best when you forget everything you've ever learn about good programming practices. Unfortunately, that still doesn't mean that good practice is expendable. Your code will still bite.
12. include() uses filenames. That's yet another namespacing thing.
13. The built-in functions all look like they were rejected from K&R C for being too terse, or rejected from Java for being too verbose. Why not just choose sensible, meaningful names? Oh that's right - no namespaces.
14. PEAR just ain't CPAN.
15. You can't interpolate array indices in strings. Poop.
16. No 'use strict;' (e.g., checking variable names)
Anyone have any responces to his opinions? I'd love to hear them...