Change language

PHP vs NodeJS vs Python vs Ruby: what do the numbers say?

PHP vs NodeJS vs Python vs Ruby: what do the numbers say?

Hey everyone! Today were going to  talk about a subject that I love: different programming languages.

And especially server-side scripting languages. Which one to choose? Which one is  worth investing time and energy in? Which language is worth choosing for back-end  development between PHP, Python, Node.js, and Ruby? Which language to learn? I love learning  new technologies so if I could I would say to learn them all. But life is short, and time is  precious, and these four languages each have different strengths and weaknesses and use cases.  Well look at them together and by the end, I hope Ill have helped you make your choice. And  a small detail before going any further: Ive limited myself to scripting languages to  avoid making too long a video, and to stay on the subject that I know well. Thats why Im not  taking a look at asp.net or java. So lets see who are the forces in play. Python was created in 1991  and version 3 was created in 2008. Then we have PHP which was created in 1994. Ruby was created  in 1995 and finally, node.js was created in 2009 but the language is an extension of javascript  which was created in 1995. Lets examine all these different languages according to different  criteria for each of these Ill distribute a total of 10 points. To do so Ill rely on two sources  of information. The first of these is the stack overflow developer survey since it measures how  developers rate different languages, and also the w3 tech website which measures real-world  usage for different server technologies. Now, why is it interesting to look at this  number? Well, it shows real-world popularity, and it gives an indicator of the level  of opportunities there are to find a job. And so here is the usage of different languages  on the servers where the language is known. Python has a 1.3% usage rate then comes Node.js  with a 1.9% usage rate. Then we have ruby which has over 6% And finally, we have PHP with  a whopping 78%. PHP is the foundation on which Wikipedia Facebook and of course, WordPress were  all built on. And to be honest, WordPress alone is present on 40% of all websites, at least those  whose technology we know. That leaves only 38% of sites using PHP once we ignore WordPress. Thats  still a factor of six compared to the nearest competitor which is ruby. And so with an almost  80 percent of usage rate in PHP and six percent for Ruby, Ill give eight points to PHP and one  to ruby, and zero to the remainder. Now lets take a look at the StackOverflow developer survey  for 2021. Well start by looking at two questions this survey asks. The first question is: This  language... do you love it or do you hate it? This question is interesting because it reflects  the satisfaction and frustration of developers. Its also a good indicator of what we could call  DX or developer experience, but its also an indicator of the consistency of the language and  the level of community. The second question is: Do you want to work in this language? Do you  desire to work in this language? This reflects the attractiveness of the language. For each language,  well take the rate of people who like it minus the rate of people who dont like it,  and this will give us a net satisfaction score. Then well add the attractiveness rate. So what  does that result in for the different languages? For PHP 40% of developers say they like it but  60% say they dont. This gives us a net score of -20 percentage points. And only 2.5 percent  of developers want to work in this language so thats a total score of minus 17.5 for PHP.  For Ruby, the situation is slightly less grim. Were just above an equal split 53% love it,  40% hate it which is a net score of +6% points, and the attractiveness of ruby is only  slightly higher than that of PHP at 2.6%. That makes a total of 6 + 2.5, 8.5 Then comes  Node.js with 63% positive opinions against 37% of negative opinions. Thats a net satisfaction score  of +26 and the attractiveness of node.js is at 12% so we have a total score of 26 plus 12: 38. Oh  and by the way for your information typescript (which can be used with node.js) has a 73%  approval rating and its attractiveness is at 15% so here it would have a total of 61%. Now  Im not going to include it in the Node.js total here but its worth mentioning. Finally,  Python has 68% positive reviews against 30% negative reviews so a net satisfaction score of  plus 36. Taking into account the attractiveness of 19 this gives it a total score of 55. Compared to  the minus 17 and some of PHP, Ruby has +26 points more, Node.js has 56 points more and Python has 73  points more. If i add all this up and divide each score by the total we have percentages that add  up to 100 and we can use that to assign points. So this gives us 0 points for PHP, 1 point for Ruby,  4 points for Node.js, and 5 points for Python. If we look at the current score we  have... for the moment in the last place, Ruby with 2 points in total, then Node.js  which has 4 points finally python has 5 points and lastly, PHP has 8 points. Now  lets talk about money and salaries more exactly mean -median-mode-in-python-without-libraries/">median salaries. StackOverflow asked developers  all over the world what their annual salary was. Obviously, the global situation doesnt  necessarily translate to each country but it does give us an indicator for a given technology.  They identified the salary that had as many people paid more as people paid less so that  gives us the mean -median-mode-in-python-without-libraries/">median salary for that technology its worth noting that the mean -median-mode-in-python-without-libraries/">median is a  better indicator than the mean or the average especially when there are disparities  and when it comes to salaries things are really even so lets take a look  at these mean -median-mode-in-python-without-libraries/">median salaries across the different languages for php that mean -median-mode-in-python-without-libraries/">median salary is 39 000 or  35 000 for you whos those of you speaking euros for node.js next that mean -median-mode-in-python-without-libraries/">median salary is 55 000 or  50 000 euros next is python for which the mean -median-mode-in-python-without-libraries/">median salary is 59 000 or 53 000 euros and finally  ruby is in the lead with 80 000 or 72 000 euros now lets do a calculation  similar to the previous question if we calculate the difference between  these amounts and the lowest of them thats php then we translate each differential to  a percentage that gives us for this round in last position php with zero points in second  position node.js with two points in third position python with three points and in first place ruby  with five points the accumulated scores are now node.js in last place with six points ruby in  third place with seven points and joint first php and python with eight points as you  can see the scores are close but for very different reasons what could justify choosing one  over the other and here comes another subtlety worth mentioning the syntax of php and javascript  are both inspired by c for example curly brackets define code blocks on the other hand python and  ruby are relatively speaking closely to each other at least visually for example blocks for  example blocks are defined by the def keyword even though indentation has a syntactic importance  in root python that it doesnt have in ruby now what could make the difference between  one language or the other well this is where the objective side of numbers finds its limit  truth be told it all depends on what you want to do more generally what your ambitions are  and how adverse you are to risk let me explain first lets take the case of python to be honest the major use case of python is  actually data and machine learning these offer interesting opportunities and salaries but they  also require a certain appetite for math python as a server side language is a marginal use  case compared to the three other languages but if you know you want to go into back-end  development and if youre worried about finding a job you cant ignore php its not an exciting  solution today but its reliable and its solid and as a side note if you want to find freelancing  worth its worth understanding how wordpress works but phps mean -median-mode-in-python-without-libraries/">median salary is the lowest of all four  conversely there are fewer opportunities in ruby but there are also fewer skilled developers this  mean s that the salaries are higher in ruby so thats why i mentioned earlier that it all depends  on your risk aversion if you want job security best go to php if youre not afraid of risk  but you want a higher salary ruby can be a good solution a good path and finally we have  node.js here the situation is slightly different node.js is a variant of javascript and as  the stack overflow service shows almost 70 percent of developers use javascript that mean s  its essential to know javascript and ideally typescript if you want to be competitive or  by the way thats precisely why im working on creating online courses on javascript and  typescript if youre interested ive added details in the description my recommendation then  is to learn typescript and javascript and then a second language depending on what you want to  do or the security you want to have theres python if youre interested in data science and  math theres ruby if youre not afraid of risk and want to try and get a job that pays more and  then theres the safe solution php its also the easy solution if you already speak javascript  but its probably not the most exciting one and if youre wondering after all  this which path to choose between back end and front-end development heres a  video to help you choose ill see you there

Shop

Learn programming in R: courses

$

Best Python online courses for 2022

$

Best laptop for Fortnite

$

Best laptop for Excel

$

Best laptop for Solidworks

$

Best laptop for Roblox

$

Best computer for crypto mining

$

Best laptop for Sims 4

$

Latest questions

NUMPYNUMPY

Common xlabel/ylabel for matplotlib subplots

12 answers

NUMPYNUMPY

How to specify multiple return types using type-hints

12 answers

NUMPYNUMPY

Why do I get "Pickle - EOFError: Ran out of input" reading an empty file?

12 answers

NUMPYNUMPY

Flake8: Ignore specific warning for entire file

12 answers

NUMPYNUMPY

glob exclude pattern

12 answers

NUMPYNUMPY

How to avoid HTTP error 429 (Too Many Requests) python

12 answers

NUMPYNUMPY

Python CSV error: line contains NULL byte

12 answers

NUMPYNUMPY

csv.Error: iterator should return strings, not bytes

12 answers

News


Wiki

Python | How to copy data from one Excel sheet to another

Common xlabel/ylabel for matplotlib subplots

Check if one list is a subset of another in Python

sin

How to specify multiple return types using type-hints

exp

Printing words vertically in Python

exp

Python Extract words from a given string

Cyclic redundancy check in Python

Finding mean, median, mode in Python without libraries

cos

Python add suffix / add prefix to strings in a list

Why do I get "Pickle - EOFError: Ran out of input" reading an empty file?

Python - Move item to the end of the list

Python - Print list vertically