In Terry Chay’s brilliant blog post about Rails and PHP, a comment read:
I agree, PHP is great, but you have to be really smart to remember 3000+ core functions, totally inconsistent function names, and writing non object-oriented nonsense like $x = some_function(’x’, ‘y’, $x) .. some of us just need something simple and logical.
I agree. So, if you are not smart, then stop coding PHP. Its a good thing that C developers are smart. They have to remember all those functions. Assembly language developers don’t have to remember functions. I guess they are not smart?
Ok, that last paragraph was tongue in cheek. Knowing 3000+ functions does not make you smart. It means you have a good memory. I will take intelligence over smart or a good memory any day. Intelligent people can use a manual to find the function they need right now and then forget it until they need it again. If they need it enough, it will be set in their long term memory.
I also want to comment on “non object-oriented nonsense”. Its good that working with objects means never having to call a function. See, they call them methods. And they don’t return stuff a lot of the time. Its like magic. Grow a set people. How hard is $x = some_function($x,$y) to understand. That is like the simplest programming concept in existence after $x=1. OOP appears to make coding easier on the front end. However, it almost always makes it more complicated on the back side.
As for inconsistent function names, I have no solid defense. I understand why they are what they are. But, that does not make it any easier on a new comer to the language. Having experience in C, the functions that are direct ports of C functions (e.g. strcmp) make sense. The PCRE functions make sense because I know that regular expressions have always been expressed in /search/replace/ format. Image Magick functions are the way they are because the API calls they are making are in the same format. That is what a lot of people don’t get about PHP. Many of the functions you are calling are (or at some point were) direct ports of some C library function. Therefore it makes sense to keep the function names and parameters in the same order as the API they are wrapping. But, like I said, that is a weak defense.