DEV Community

Discussion on: Node vs PHP

Collapse
 
mabalashov profile image
mabalashov

Node is the best for BFF applications
PHP is the best for enterprise application with a lot of business logic

You should choose the platform for your current aims

You should choose NodeJS if:

  • you are going to create a small application for one evening
  • you have no experience in backend and you need a server part for your frontend
  • you have a lot of IO (ex. sockets) in application
  • you have enough experience in both technologies and you understand the pros and cons of each one

In other cases (especially if you want your application to be secure and reliable) you should choose PHP

Long story short, the main differences are:

  • PHP dies after each request => you should care less about memory leaking and secure. But each request is more expensive in PHP if we are talking about performance
  • It is easier to write clear code in PHP because of the mature environment and language-specific features. PHP is a really OOP language. Yes, JS has TypeScript but it is simpler to use C# instead of TS