Node.js JavaScript vs PHP: Which programming language is winning over developers?

A report highlights the growing popularity of Node.js JavaScript as a server-side language to support online sites and services.

Node.js JavaScript vs PHP: Which programming language is winning over developers?

PHP has long been the cornerstone of the web, with the programming language running on servers used by a huge number of websites.

But a report out this week highlights the growing popularity of a different server-side language, as more firms turn to using Node.js JavaScript at the backend of their sites and services.

While JavaScript has long been used as a scripting language in web browsers, in recent years it's also started being used on servers at the backend of the web, running inside the Node.js environment.

As the web becomes more capable, moving beyond simple websites to also include single-page web apps, so the use of Node.js JavaScript on servers is increasing.

That shifting usage was evident in a survey this week, with developers who use the front-end Vue.js JavaScript framework reporting they use Node.js JavaScript as a back-end language more frequently than PHP, as you can see below.

Node.js 53%
PHP 44%
C# / .NET 19%
Java 19%
Python (Django, Flask, etc.) 19%
Ruby (on Rails or otherwise) 10%
Other 10%

The findings echo those of the State of JavaScript 2018 report, where Node.js was found to be used by 63% of respondents, versus 50% for PHP.

SEE: IT Hiring Kit: Programmer (Tech Pro Research)

The growing popularity of Node.js JavaScript was captured by 2018 Node.js User Survey , which also shed light on how the language is being used.

"Node.js continues to see it's popularity grow on every continent and in a very broad set of use cases due to its flexibility and utility for a wide variety of use cases", it stated, with web apps being the most popular use case, followed by enterprise apps.

Of course, the problem with the surveys above is they are canvassing developers who work primarily with JavaScript, and who as a result may be more likely to choose Node.js at the backend.

It's also not necessarily the case that firms either wholly use a single back-end language. Organizations may use Node.js JavaScript for some sites and services and PHP on servers supporting other sites.

That dual-use is borne out by the surveys, with almost one third of developers saying they used PHP alongside Node.js in the 2018 Node.js user survey, while respondents to the Vue.js survey also reported using a variety of languages at the backend.

It's also likely true that the majority of the world's websites still run on PHP, given its use for hugely popular Content Management Systems (CMS) such as Drupal, Joomla and Wordpress. That legacy of a huge number of sites running on PHP means demand for developers with PHP skills is unlikely to dry up anytime soon.

And while PHP may be lagging behind JavaScript when it comes to its popularity as a language to learn, it still made the top 10 in last year's Stack Overflow Developer Survey's list of most popular languages.

But the signs are there that a gradual transition away from PHP on the web may be continuing to take place.

Also see