Content

PHP vs Node - JavaScript is eating itself (programming)

Page is part of Articles in which you can submit an article

written by owen on 2018-May-20.

related image
related image

We see this "change for the sake of change" all the time in the tech programming market place. People who favor one thing then go around seeking out the next popular thing around to help to boost the popularity of their favorite baby. This is a tendency of future geeks; people who are always on the cutting edge with half a million unfinished projects. They tried to de-throne SQL by saying that NOSQL is the future but with nothing to show for it. Eventually that hype machine quickly died down. These are all different versions of "moving the goal posts". The new rivalry seems to be between Node.js and PHP. PHP and Node are not even the same or competing things but alas the devil will always find work for idle hands.

I am not going to fall into the usual trap of trying to explain why one is better that the other because there is always a best tool for the job or a discussion trap waiting to happen. They both have advantages and disadvantages. What I am going to do is a simple comparison that shows some scenarios involving Node and why you should not compare it to PHP. The problem with Node is surprisingly "JavaScript". JavaScript is Node's biggest problem. JavaScript is eating Node and Node is eating JavaScript. You could probably run PHP in Node but no one wants to talk about that because their baby is Javascript.

One could debate forever the ins and outs of various languages and why people use them but in a situation where you have 2 things which are so different from each other it is pointless to try to conflate them. It appears that the Node.js crowd is not concerned about what they step on as long as they rise to the top of whatever the top is. We need more Node.js game developers.

The Experiment

Anyway lets look at Node vs PHP using a basic github search. All figures are based on the time of writing and might change in the future but it is highly unlikely because JavaScript. Note however that I chose to search for "php" and "node" because "node.js" returns far less results and falls under the heading of JavaScript. I am going to use the numbers in the top left corner of the results to form a conclusion.

Definitions

According to Github;

"PHP is a scripting language that works particularly well for server-side web development."
"Node.js is a tool for executing JavaScript in a variety of environments."

Right off the bat you can see Node is refered to as a "tool for JavaScript" and PHP is a "scripting language for server-side". The difference is wording should be noted because referring to it as a "tool" instead of "platform" or a "language" is an important problem when you try to compare them. They are 2 different things.

Repositories - PHP 354k VS Node.js 437k

From this count one would guess that node is more active that PHP just from the bare numbers. I imagine that this number will continue to increase as more developers throw up random Javascript code that they soon forget about while hoping some people jump on and contribute.

Code PHP NULL vs Node 399M


I am not sure why the PHP value is empty I figured they just stopped counting it.

Commits - PHP 13m vs Node 87m

The Node.js people are really really busy apparently writing lots of Javascript. The Node crowd is all into having github in their tool chain so I would imagine that every noob on the planet is just forking/checking in every hello world sample they can find. Heaven help them if git ever gets hacked and the changes propagate.

Issues - PHP 2m vs Node 2m

Now it seems that even though the Node.js crowd is doing 7x more code commits than PHP the amount of issues are pretty much equal. This is interesting. The people posting issues could be the same in both communities. Or maybe most of the Node.js code is issue free and just works? Or remains untouched, deprecated forever?

Topics - PHP 1k vs Node 1k

Similar again. Very strange.

Wikis - PHP 184k vs Node 218k

Node has slightly more wikis than PHP. I will need to dig into this wiki thing some more. It might also be linked to new developers.

Users - PHP 25k vs Node 8K

PHP wins this category by a factor of 3 to 1. The Node.j developers with less people are writing more code and creating more repos at a rapid pace. From this I could extrapolate that either the Node code is bloated beyond comprehension or the same people are creating many many repos at a rate that out paces the PHP devs which are 3 times their size. This is most likely a fault of the fragmentation of Node.js. Node coders writing Node code for other Node coders to use. Classic eating you own dog food syndrome.

The Languages Side bar

PHP has obviously PHP at the top with 226k while Node has Javascript at the top with 294k. Nothing really telling here other than that PHP also has Javascript in there for some reason.

Results List - Best Match - PHP vs Node

First entry for PHP is "docker-library/php" - Docker Official Image packaging for PHP with 1.2k stars and is tagged as a "shell". First entry for Node is "nodejs/node" -
Node.js JavaScript runtime with 46.2k stars and tagged as "Javascript". The fact that the Node run time is itself on github has a whole lot of implications to the numbers before especially when it comes to the number of commits and the amount of code. PHP source is also hosted on github but does not show up as the Best match. I could extrapolate that Node is in such a state of flux that IT IS ITS OWN BIGGEST FAN.
Results continued; PHP - 2, 3, 4, 5,6. Node - 2, 3, 4, 5.
The PHP results are all over the board while Node seems to be content on constantly updating and promoting itself.

Bits and bobs

When you visit the topic pages for both PHP and Node you get different repository counts which are probably curated: PHP = 32k vs Node 7k. This is most likely because PHP has been around since 1995 and Node being fresh since 2009. Giving PHP a lot more history but at the same time "Node.js extends the creative potential of people with web development experience, enabling a new generation of developers to create servers, command-line tools, desktop apps, and even robots." Yes, Potential.

Conclusion

PHP and Node.js are two different things. They do not need to compete with each other. If Node is any good then it will prove itself over time. Stop the whole "language of the future" wars. Node is not a language.

permanent link. Find similar posts in Articles.

comments

    Comment list is empty. You should totally be the first to Post your comments on this article.


comment