Why PHP is so much more popular for web-development

Jeff jeffober at gmail.com
Wed Jul 25 22:10:52 CEST 2007


I'm an ex-PHP programmer (well, I still have to use some PHP at work,
but I don't tell anyone that at parties) who now uses Python or Lisp
wherever possible for web development.  I can tell you exactly why PHP
is so popular: it acts as an extension of HTML and is syntactically
similar to Perl.

PHP mixes with HTML and removes the separation of model and view.  It
has its roots in strictly procedural code (and its OO colors were
obviously painted on later), which is simple for non-programmers or
beginning programmers to understand.  When considered from the
standpoint of a template language, it's a wonderful language.  When
considered as a real programming environment, its limitations show.

PHP began as a series of Perl scripts.  If you have ever looked at a
huge PHP project, it looks just as unreadable as a huge Perl project.
But there is a large number of programmers who began writing Perl-
based CGI for the web, and PHP was a very natural next step for them.
This is also a big reason why Ruby is popular among the same crowd
(...I say as I duck the inevitable flame war I've just started).  Ruby
takes a lot of concepts from Perl and tries to make them work in an OO
framework (the ~ operator and the built in regex type, for instance).

I started with PHP for both of those reasons.  Perl was becoming too
much of a chore and PHP offered a solution without learning a new
templating language: a way to embed perl code in the page itself.

Of course, now I am in recovery and am proceeding well with my 12
steps, thanks for asking.




More information about the Python-list mailing list