What are a few scenarios, where you would prefer to work with PHP instead of NodeJS? Answers preferred from those who have worked on both of these technologies.
This is purely based on my experience!
I use PHP way more often for just plain CRUD applications, which are redundant, or like CMS for small-medium enterprises. Not only it speeds up my development time, it has hell a lot of support too.
I use Nodejs, simply to see Websockets. I don't see any other way to use Nodejs, as pretty my PHP/Java does the job for me. Maybe I'm a noob, that's why?!
are the most fundamental things that come to mind. the rest is more about how the languages are built and used.
I've used node.js for everything since 2011, so can't think of any reason to use PHP.
Both PHP and JavaScript have a plethora of tools and libraries big enough to do almost anything as far as web development goes.
That said, I would always write JavaScript over PHP, except for those rare situations where PHP is the only option (the codebase is already PHP or the required platform only supports PHP). I just find it nicer to write and read.
Not that it matters, I find Python to be a much better choice in most situations.
Marco Alka
Software Engineer, Technical Consultant & Mentor
I use PHP when working on any website which does not need RTC and does not have ten thousands of visitors per day. That's why all websites I create for money as a sideline use PHP. PHP is available anywhere. It is reliable, easy to use and allows for fast prototyping.
However, I also really love new toys, like WebRTC and WebSockets. So when working on certain hobby projects or products for my company, I use those techniques to speed up communication and allow for amazing new features. That's when I use Node.JS.
If performance matters and your algorithms can be written highly concurrent, Go might be a good alternative. Other than that, Java is an industrial standard, though when it comes to number crunching, I'd go for Rust.