

PHP Just Grows And Grows - taylorbuley
http://news.netcraft.com/archives/2013/01/31/php-just-grows-grows.html

======
lukifer
PHP has no shortage of weirdnesses and warts, but it occurred to me recently
that no other major language was created expressly for the purpose of
rendering web pages. All the other major contenders (Python, Ruby, Java, etc)
are, for better or worse, general-purpose programming languages, which are
pressed into service for rendering HTML strings using various libraries and
frameworks.

The common wisdom is that PHP's success is due to ubiquity, deployment, and
low barrier to entry. While all those are true, the fact that so many web-
focused tools are baked into the language itself (meaning minimal time to
hunt/learn/evaluate third-party libraries) shouldn't be ignored.

~~~
Legion
> PHP has no shortage of weirdnesses and warts, but it occurred to me recently
> that no other major language was created expressly for the purpose of
> rendering web pages. All the other major contenders (Python, Ruby, Java,
> etc) are, for better or worse, general-purpose programming languages, which
> are pressed into service for rendering HTML strings using various libraries
> and frameworks.

For non-trivial web applications, the "rendering HTML strings" is one of the
smallest parts of the job.

The lack of separation between application and HTML output in PHP may be an
asset when starting out or when making lightly scripted web pages, but when
creating an application that just happens to be served up over the Web (and
possibly served up other ways too), those general-purpose languages are much
more natural fits for the job.

~~~
jtreminio
Hey, it sounds as if you don't know what you're talking about - at all.

You _can_ write a single PHP file that includes HTML, Javascript, MySQL, CSS
and PHP, but that would make you a bad developer, or it's such a simple one-
off thing that you don't worry about it.

Or, you can develop with maintainability in mind and separate those 5 concerns
out.

~~~
Legion
> You can write a single PHP file that includes HTML, Javascript, MySQL, CSS
> and PHP, but that would make you a bad developer, or it's such a simple one-
> off thing that you don't worry about it.

Tools facilitate workflows. The fact is, PHP very strongly facilitates your
"bad developer" path. That's why there is so much PHP code that goes down that
path, compared to other languages.

Yes, you can go off on a better path. But better designed tools make it much
more easy and natural to do things the "right" way.

PHP makes your "bad developer" path the path of least resistance. That's bad.

~~~
BlackAura
This isn't unique to PHP, by any means. Visual Basic was much the same, even
in later versions where you actually could write well designed code if you
knew what you were doing. The IDE, documentation and design of the language
encouraged you to make bad design decisions, much like PHP.

.Net languages aren't immune to this either, particularly Windows.Forms and
ASP.net. To write decent code in those, you basically have to fight the IDE
and the framework every step of the way. ASP.net MVC makes it much easier to
write good code, at the cost of being harder to user if you don't already know
what to do. Your average newbie can't just point and click until he's half way
there.

PHP has decent frameworks, like Symfony. They make it much easier to do the
right thing, and harder to do the wrong thing, at the cost of being more
difficult to learn.

Props to the Symfony team though. They're still trying to make something good
out of PHP long after most other decent developers abandoned the platform on
favour of something less newbie-driven. It helps a lot to have that kind of
framework available, just in case I have to use PHP for something.

Edit: Accidentally said that ASP.Net MVC encouraged bad code, but meant it
encouraged good code.

------
xd
"ease of extending the language played a large part in its tremendous
success,"

It's the reason I picked it up back in 2001. Being a C programmer up until
that point it made the transition to web development incredibly easy.

On a side note, I still remember how awesome being able to do `"some string"
== $var` was.

~~~
taylorbuley
The spaghetti structure is one of PHP's biggest strengths and weaknesses.

A novice can just pick up PHP and run with it. She can start blindly with
unstructured code, then move to methods, then finally to OO.

The downside, of course:
[http://www.flickr.com/photos/raindrift/sets/7215762949290803...](http://www.flickr.com/photos/raindrift/sets/72157629492908038/)

------
taylorbuley
Amazing that you can see such dramatic and sustained growth even on a
logarithmic scale

~~~
lemcoe9
They really didn't mention that it was on a log-scale. That's pretty
significant to make very prominent in the article...

~~~
klibertp
Um, the plot is titled: "PHP Trend (Logarithmic Scale)"[1]... Isn't this clear
enough? :)

[1] [http://news.netcraft.com/wp-content/uploads/2013/01/php-
tren...](http://news.netcraft.com/wp-content/uploads/2013/01/php-trend.png)

------
jere
> _If you find yourself repeatedly putting down a technology, then take some
> time to actually learn and use it._ All the jokes and snide remarks aside,
> Perl is tremendously useful. Ditto for PHP and Java and C++. Who wins, the
> person who has been slamming Java online for ten years or the author of
> Minecraft who just used the language and made tens of millions of dollars?

<http://prog21.dadgum.com/123.html>

------
rbchv
It would be interesting to compare PHP's growth with Ruby and Python.

For a starting developer, does it still make more sense to learn PHP?

~~~
jtreminio
There is an absolute glut of PHP positions right now, for both inexperienced
and highly experienced developers.

You'll have to be extra-diligent about making sure the sources you're learning
from aren't full of security holes, however.

~~~
adamors
Security holes, or just bad practices in general. My biggest gripe with PHP is
that every CMS, framework, custom built site uses a different style, some echo
HTML some even output HTML in the middle of a class definition etc. I remember
reading popular Joomla! extension that counted the number of elements in a one
dimensional array with a for loop.

~~~
jtreminio
Drupal, Joomla or Wordpress are not examples of quality PHP products. They are
extremely popular because they _work_ , not because of their quality.

If you want to see quality, look to the new generation PHP frameworks: Zend
Framework 2, Symfony2, for example.

~~~
ceejayoz
It's an interesting definition of "quality" that doesn't include "the product
works".

~~~
jtreminio
I didn't say it wouldn't include. A Ford Fiesta "works", but is not quality.

------
garazy
I think we've reached "Peak PHP" our data[1] shows PHP isn't growing at all in
the top million sites and Netcraft's data reflects that if you take the
"active sites" bar back to the middle of 2011.

[1] <http://trends.builtwith.com/framework/PHP>

------
dubcanada
Oh no an article with PHP in it, here comes the PHP SUCKS BLAH BLAH!

------
cyrilg
The problem with php is that there is no central registry where you can submit
your own module like Ruby gems and npm registry for node.js. It feels like you
have to reinvent the wheel every time you work on something new...

~~~
ericras
<http://pear2.php.net/> <http://getcomposer.org/>

