Why Node.js instead of PHP

Hello, why Free Code Camp choose to teach Node.js instead of PHP which seems to be easier, and mostly 80% of websites are using PHP so saying in short it’s more popular and wanted in my opinion.

Regards, Matthew.

2 Likes

Hey @matevos Quincy talks about why he picked Node here Will Free Code Camp ever move away from web development and teach other languages?

3 Likes

The stat that 80% of websites are using PHP comes from the fact that a huge portion of the internet is powered by Wordpress, most of which don’t require an actual PHP dev and are managed by business owners and individuals. That’s not to say people don’t use PHP and Laraval, but it’s definitely a language in stagnation (or decline)

Node.JS handles concurrency and IO much better than PHP and leverages the existing JS skills that a web developer already has, simplifying the learning process.

I say learn whatever you enjoy! It depends somewhat where you live, but nowadays you can pretty much find dev jobs open in any language. Learn practical skills and make cool projects in whatever you enjoy and show it off – someone will hire you!

10 Likes

I’d also like to see a statistic of that 80% claim.
I would venture a guess that whatever that number currently is, it’s been decreasing rapidly since the emergence of Ruby On Rails, and then even faster as soon as Node entered the scene.

I heard PHP is slowly dying as people are moving on with NodeJS and Ruby/Python as back end languages. Don’t quote me on it.

I know FCC has an emphasis on teaching the full stack in Javascript, one reason being that you can code the entire web stack in this language. I think there are some advantages for doing this because all the code is in the same language, and I have read that Javascript is gaining in popularity for this reason. However I am still learning and know nothing about PHP so I would like to hear other people’s opinions!

1 Like

My opinions about PHP the language are strong and not even a little bit complimentary. But laying those aside, I feel I still must pile on and point out that PHP is in fact in rapid decline:

  1. It has no credible REPL or standalone environment. Many languages do fine without a REPL, but the standalone environment itself leaves much to be desired. Yes, there is a php command, but it still lacks real integration with the underlying OS. It was designed from day one to be embedded in web pages, and it’s still day one in PHP’s world.

  2. Really just a continuation of the first point: it doesn’t deploy without piggybacking on an existing web server. This means configuring the web server often in unusual ways to facilitate rewrites (because PHP can only understand running out of a file, not a whole path). And that’s assuming you even have that kind of access to the server. And while PHP has a built-in server of sorts, its own docs go to great lengths to tell you it’s a toy you can’t possibly use in real sites. And the docs are right.

PHP was designed to ride along with apache, then it found a few more gateway interfaces, but it never broke out on its own. So even if the language itself were cleansed of its many many WTFs (probably not possible), it would still struggle to find a place in modern web dev.

1 Like

In my opinion, PHP is way ahead than node.js because it is considered to be the simplest and offers the developers to combine coding with content, as it can do faster coding without compilers, deployment and JAR files. Moreover, php is synchronize with MySQL and most of the stable code and developed interface is done with SQL database which is linked to the PHP only. Furthermore, It is an undeniable fact that pure HTML usually works and it is optimised by PHP. Besides, it is used by several renowned websites like facebook, yahoo and many more.

1 Like

Hey, I agree with you that the most basic stuff (editing html based on variables / form submission / sessions) might be easier in PHP (no real setup needed). Most people here are already familiar with javascript and so Node is way easier, than PHP with its weirdness.

As far as I know it is possible to connect to a SQL database. Also Node is quite new, so it is logical that Facebook etc. don’t use.

While I was in college taking PHP, VB and Javascript course in the same semester it was very difficult to keep the syntax straight and try to remember which one was which. Keeping everything focused on Javascript (at least while learning) makes things a lot simpler.

2 Likes

But there exist a lot of companies use PHP

But JavaScript will take over. Plus, PHP is an annoying programming language.

OMG, I see so many people here from the other side of barricade :slight_smile: I’ve been coding in PHP for almost a year, and I had very negative attitude to JS and jQuery as this language was pretty unclear and chaotic for me, comparing it to simple PHP. On the job market, job offers searching for PHP and JS devs are equal I believe, however PHP is much simpler to learn.
I’ve just started freeCodeCamp as unfortunately more often I have to do frontend stuff (i prefer backend) so I need to learn JS and probably will look later on backend solutions here.
Replying to Oxyrus - I think javaScript is annoying, PHP is so simple and clear ;] However these 2 languages have different purposes to use.

5 Likes

When I was in school they focused on mostly, C# asp.net, python, tiny bit of java, and javascript. While they did not cover anything about node js they covered some angularjs and knockout. Professors gave me funny looks when I would implement tasks with php until I explained that there are good and bad to all languages.

If you look at the job posting trends you will see a steady downward slope which will make it harder for a newcomer to get a job in php since there would be more seasoned developers who may be looking for a job and have preference over an entry level. Feel like some of it may have to do with the fact that server resources have changed, single language for a stack, and the exhausting amount of new js frameworks coming out have made companies want to switch to new tech.

PHP may be on its way out for being the standard but I don’t think it will completely die out. Be very doubtful that Facebook would abandon their version of php for express/meteor/whatever new thing comes around.

Well currently for newcomers, at least in Poland, most of Junior job offers are for Java Developers. Junior PHP Dev is not hanging on job sites every day, however regular lvl have plenty of those showing up every day. But with good attitude you always find your first Junior job for every language :slight_smile:

In the UK, the evidence is that PHP is holding steady as the 6th most popular language (after SQL, Javascript, Java, C#, and Python but ahead of Ruby).

That said, PHP and Wordpress are amongst the lowest paid and least glamorous in programming.

1 Like

I believe for junior jobs PHP is the who offer more opportunities

Modern technologies is much more profitable (not only in $$$).
JS is number one on Github, has tons of frontend/backend/mobile(react native) frameworks, much biggest market.

After my first meet with PHP I feel yourself in the beginning of 00’s with horrible syntax and slow code, the same for PHP7. That’s why I’ll never recommend PHP anymore.

80% of websites? Not sure. Guess 99% from PHP websites are the funny CMS for corporate and private blogs, nothing special.

@matevos Hi. Matthew. Good question.
If PHP was the main language on here I probably wouldn’t be here!
I am an experienced dev and want to learn the newest ideas in the development world so that’s why I am studying here.
I already know some PHP / MySQL from previous work and studies but never liked it much because I found it difficult to debug.
If you look at the stack on here it is all pretty much JS - algos, jQuery, MongoDb, NodeJs, React, d3 are all Javascript based, therefore you are not having to switch to teach different languages. Makes sense to me…and it’s easy to debug! :slight_smile:
This video I watched yesterday is on a similar topic.
Here he talks about CSS Grid vs Bootstrap but he discusses other tech too.
If you want to practice PHP I recommend codewars.com

PHP maybe dying, but it is from a great height (popularity wise). There is a lot of codebase in PHP and there seems to be plenty of jobs. While javascript is more popular, PHP is way more popular than node.js when it comes to job listings.

There is a massive bias against it and there doesn’t seem to be many new devs learning it. So I thing there is an opportunity for people to get their foot in the door if they take the turn to learn it.

At lot of PHP devs are self though so the might be more willing to take on self thought develops as well.

Node is ideal if you want to focus on being front end developer and just want to be able to bootstrap projects easily but if you want to become a backend developer by self study I believe you will find a job much easier with PHP.

1 Like