Is it worth it to learn php or can you just use node instead?

Anything that PHP can do, Node can do. Almost anything Node can do, PHP can do. Node is more modern, and has great support on most hosts.

PHP does (last time i checked) have better performance for single threaded execution/computation than Node, but web ends up being more about (in most cases) handling IO, which Node does better

Node has better package/dependancy management than PHP in my opinion (although neither are great honestly. Node modules can end up pretty big...)

Javascript doesn't really have types but PHP does. Typescript fills that gap mostly with JS (with a few gaps, but overall its pretty solid)

You'll need to use javascript anyway for web to do the front end, and a lot of people seem to think that using the same language front and back helps. I have no opinion, as I am a backend engineer and never touch the UI.

I've worked with both PHP and NodeJS. I'd rather work with node & Typescript than any php framework.

/r/learnprogramming Thread