Response to 10 reasons why I use PHP

Read this article:
10 reasons why I use PHP

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.

  1. 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.
  2. 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).
  3. It’s Performance

    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.
  4. The low cost

    Let’s see… How many “0 cost” languages are there…

    • C
    • C++
    • Perl
    • Python
    • Ruby [or else I'll get email]
    • …oh, all languages are zero cost… except for things like coldfusion
  5. 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.

  6. 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.
  7. Its Portability

    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.
  8. 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.

  9. 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.
  10. Support available

    Heck, there’s support available for REXX — both for $$ and free, but should you use that as a basis for greatness?
  • http://krillz.com krillz

    Sure, those points apply to most languages out there, and yes there are better languages for different jobs, it’s not like only php coding is on my mind.
    For some tasks python, c or java seems like a better option.

    Easy, there are a lot of other languages that are easy to learn, yeah I know, but that doesn’t make that point any less valid, just a statement which I think most php coders agree with, it was damn easy to learn compared to other languages, less to think about compared to c for example.
    this was a list of why I like PHP, not a compare it to another language.

    And this list was more of why _I_ use PHP and nothing with me wanting to portray it as why you should learn it right away.
    Funny thing that people react in this way, like I stepped on someones toes by just mentioning PHP.

    Build in libraries, my point with this was that you do not have to code certain functions to perform various web-tasks, as they most likely already exist. And I agree on the point that it’s a nightmare to get two libraries working with each other.

    PHP is portable, well if you read what I wrote under that headline, I wrote “will usually work with no hassle” I didn’t write will certainly work with no hassle.
    Depends on the code indeed.

    The OOP in PHP isn’t near complete, and the word strong I admit was a bad word to use there, however when writing it I more thought of php4 compared to php5. Comparing it against a real OOP language it lacks a lot.

    9,10 still valid points, no lie here.
    That Perl or any other language had that way before PHP did, great.
    However what does that have to do with the list?
    Did you get offended by PHP implementing the same?
    I mean again feels like by writing about PHP i stepped on your toes.

    So a part from 2 comments that were good, 3&8 I don’t see why the other ones would have anything to do with the points not being valid?
    Anyway I take any criticism as good feedback, always good to see other peoples point of view.

    cheers!
    Krystian.

  • koblas

    For background, I write PHP 7 days a week… Ok, maybe only 5 with some random weekend work. I’ve written everything from PDP-10 Assembler (so I wrote far more 6502 assembler than PDP-10) to C and Java (along with PHP).

    I just find it amusing to read why people like languages… I’ve got a lot of issues with PHP, though it’s suffers from the ability to make horrible code (not as bad as perl) but not great.

    Point # 9 — Database access — It’s a baseline assumption with a language that is intended to be used to build websites.

  • http://unclehulka.com/ryan/blog/ Ryan Kennedy

    Reason #11: Because that’s what my company uses. When I was in college, I wrote in Java because the classes were taught in Java. When I got out of college, I wrote in Java because my first several companies all used Java. When you spend 8+ hours a day writing in one language, I think it becomes second nature.