Feedback

Your feedback is important to keep improving our website and offer you a more reliable experience.

 

By David Stewart on September 24, 2015

 

One of the many fascinating details of Dune, Frank Herbert's science fiction classic is the use of special-purpose languages. For example, a clan would use a "whistling language" or a "battle language" to communicate military information succinctly and secretly. But a battle language is a poor choice to use to whisper into the ear of your sweetheart. At least, if you want to be romantic.

When I got my start with computers back in the 70s, I started with a couple of languages, Basic and Fortran. Basic was excellent for beginners and Fortran for almost everyone else. In college I learned a couple more languages for systems programming: Pascal and C. When I became a professional, I had to learn object-oriented languages like Java and C++.

Today there is a profusion of computer languages targeted at different activities. It's important to choose the right one. Just because you may dearly love your mitre saw, it would be a poor choice to use it to hammer in a nail.

A lot of programmers love Python because it's so fast to implement stuff, but it can be a pain to use to create a simple website. I heard the story of an engineer taking a month to use Python to create a new web site which displays data from a file or database. Another engineer was able to create the site in just a day using PHP.

Now realize, neither of these engineers were creating websites as their "day" job. They just needed a web page quickly from scratch to display some information. 

PHP is the most popular choice for implementing active content in a website. And it's rather obvious once you dig into it. As you create your web page in HTML, PHP code is very easy to stick into the HTML, such that when the page is rendered, the code is run. For example, to show the results of a database query in a web page, you can use markup languages like HTML with CSS to format the look of the page and insert PHP code into the HTML to do the database query.

Doing the same thing in Python alone is rather difficult. Usually some kind of framework such as Django is needed to link up the Python code with the web page. 

Statistics don't lie - I read studies which show that 70 - 80% of the world's web sites are implemented in PHP. Really famous sites and content management systems like WordPress, Wikipedia and Drupal are implemented in PHP. Facebook itself depends so much on PHP that it created its own open source PHP engine called HHVM

Because of the large number of engineers working on Facebook's pages, they actually developed a refinement of PHP called "Hack" which is a more strictly typed version of the PHP language and should improve the productivity of teams working on the code. But Hack still generates PHP bytecode which is interpreted by HHVM.

Of course there are other languages used on websites, amongst them Ruby and Node.js. But there is no denying the breadth of PHP adoption as a language on the web. 

We recognize the value of PHP and HHVM as interpreters which are running a lot of websites out there. And since they are open source projects, we're able to contribute code to improve them and everyone can benefit. In particular, we're measuring some excellent throughput improvements to complex workloads such as WordPress, MediaWiki and Drupal as a result of our patches. More on this in a future post.

Source: Intel Software | Article: PHP - the right tool for the job? by David Stewart