interesting article

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

interesting article

Post by m3mn0n »

(warning, it does nothing but bash php :wink: )


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...
Post Reply