DEV Community

Discussion on: PHP and Node... Which should I learn?

filips profile image
Filip Š

Learn and use both, depending on what you are developing.

Node.js is often (but not always) better for real-time applications (WebSockets) but for other things, PHP is better. Both languages have good web frameworks and are extensible with third-party libraries and frameworks.

Some people say that because PHP is old, it is bad and weird. Some of this may be true. However, in the last few years, especially since PHP 7, it has improved a lot and many things got fixed. At the end of this year, PHP 8 is expected to be released and it will include JIT and other performance and functionality improvements.

Some people also say that JavaScript is weird so you shouldn't use it. This may also be true, however, JavaScript also improved in last years since ES6. However, for some things, you may still need transpilers to support some Node.js versions, but they often aren't hard to set up.