Read this article:
Somebody is writing a book and cite these as the 10 reasons to use PHP, it’s scary. Here’s their 10 reasons, and my commentary.
The PHP Community
I’ll agree that php.net set a new standard in language reference websites. The ability for users to comment on manual pages for functions is amazing. It turns a dry resource into something useful, code samples etc.etc.
Learning PHP is easy
Basic is easy, Logo is easy… any interpreted language should be easy to learn. Since you are isolated from the system (no pointers to use, no memory to allocate). The other advantage that all modern interpreted languages share is good associative array constructs (thanks to Perl setting that standard).
Ah.. no… While you can build an application that serves millions of pages a day on a server, when you really look at the performance of the language it sucks. You are still orders of magnitude from real performance. Not only that, but since PHP is designed around a single process model your ability to share data structures or connection pool resources is left to native code libraries.
The low cost
Let’s see… How many “0 cost” languages are there…
- Ruby [or else I’ll get email]
- …oh, all languages are zero cost… except for things like coldfusion
It’s Open Source, You can modify it
You can modify it if you need a hole in your head! Technically the point is that it’s an open source project and they release patches often. You’re point is that the community is actively working out the bugs. So, what any active language is doing this..Unfortunately C, C++ and Perl have all “died” at this point and will pretty much remain static at their current functionality.
The built in libraries
Java really is the library winner. PHP libraries are pretty sucky and are mainly written for PHP4, sure there’s PEAR and PECL… But, getting any two libraries to interoperate is a pain since PHP doesn’t really have #8.
C is portable, it’s just the OS bits that aren’t. A lot PHP isn’t portable to Windows since people don’t use the OS abstractions to avoid some problems.
It has strong Object-oriented support
Cough, Cough.. You’ve got to be kidding… The OO in PHP5 is better than nothing, but I wouldn’t use the word “strong”. Did you know that associative array’s are 20% faster in PHP5 than using objects? There also isn’t a strong set of base classes that can be used for abstractions.InputStream and OutputStream are great bases for any abstraction, it means that filters and other constructs can be layered and wrapped with no issue… Unless you build a whole class system from the ground up — of course then you’re the only user — there’s not a great OO approach to most problem.
It has interfaces to a large variety of database systems
True, but so does every other web programming language.. Perl had DBD/DBI before PHP was a twinkling in anybodies eye.
Heck, there’s support available for REXX — both for $$ and free, but should you use that as a basis for greatness?