DEV Community

Discussion on: PHP vs Node?

Collapse
 
vimmer9 profile image
Damir Franusic • Edited

I know I'm playing with fire here so please keep in mind that starting and endless discussion is not my intention.

I prefer PHP over Javascript. They are both programming languages and choosing one over the other is a mater of personal preference. People keep mentioning Node.js but that's a runtime for javascript with mod_php being the same equivalent for php interpreter in Apache. They are made for different purposes; Node.js apps are standalone apps which are better suited for persistent long lasting connections for example, while php is meant for exec-and-exit situations like single page renderings, etc. I have even written shell scripts in php just because syntax is more to my liking than bash.

You could also do a long running apps, persistent connections and numerous other insane endeavours with php, but maybe with a lot more effort than doing the same thing in Node.

Once again, I am not a fan of Javascript but have used it on both client (React) and server (Next). Beginners will for sure find asynchronous Node programming much harder than php. I don't understand how php syntax if more complicated than javascript 🤔

PHP is constantly being updated and has come a long way and although It's been a while since I last used it, I'm sure the security issues are much less frequent nowadays.

Maybe I'm just biased since php was my first web language, but it deserves some respect and it certainly doesn't deserve all the flame coming from javascript-only developers.

P.S.
Anyone remember Tomcat App Server? 😉