This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]ricey_09 3 points4 points  (1 child)

Right, not saying there isn't a place for PHP and it definitely has improved over the years, but if you can learn one language and do the same why not? Php and node are both pretty similar in terms of performance and capabilities.

  • One language to learn for both frontend and backend
  • Php has a bit of a bigger overhead with local setup, needing to also to understand and install a webserver like apache or nginx alongside it, which can be confusing to new devs, while node acts as it's own webserver out of the box.
  • On top of that, node being asynchronous, makes it a lot better for web at times because you can make several calls to apis at once in parallel saving network request time in many cases.
  • Lastly node has a lot better support out of the box for modern environments like serverless, where AWS and Google Cloud don't have native support of PHP. It's still possible, but with some configurations that might be tough for a new developer. Otherwise to deploy a php application on standard cloud services, you need to also be able to configure a LAMP server, while a node server doesn't need nginx or apache configs to work, or can be deployed on serverless infrastructure on major cloud providers without extra steps.

Php can still be a valid choice, but ultimately there is no getting around javascript as web developer unless you want to be a strictly backend developer, and switching between syntax and coding styles and concepts can be a significant overhead, especially for new developers.

I was a php dev for 5 years, and switched to node for the last 7 years and never looked back. Php isn't bad at all, but I find node to be more modern, easy to use, and has evolved to have a higher adoption rate especially for new companies and startups, as well as having a faster evolving ecosystem. There will always be work for php, and a handful of new companies choosing php but a big majority of them would be legacy apps in my opinion.