11 AnswersNew Answer
The answer isn't a simple yes or no. Neither is overall better than the other. I, personally, would lean toward PHP but that's because I have more experience using it and won't need to learn as much to finish a project. I wouldn't recommend PHP over NodeJS to others as a general rule. For a given project, I would generally use whichever is most familiar to me or the development team that will work on the project in question. My past projects have mostly used PHP so I'd continue to do that unless NodeJS's advantages came into play. NodeJS would be good if project requirements leaned toward a single page application or a few NodeJS tools would be needed. AngularJS doesn't require NodeJS but that's a popular pair so documentation could be more helpful to use those together. Generating PDF files from HTML is a common requirement and a nodejs tool called puppeteer can do it. Enough nodejs-related tools like puppeteer and the project will be overall simpler using NodeJS than PHP. Fewer different languages = simpler. There is a more detailed comparison at: https://www.geeksforgeeks.org/php-vs-node-js/
David Carroll Loved the answer sir 🙂👍
David Carroll Josh Greig good answers to you both, thanks. but realistically how often do you get you make these decisions in a vacuum? doesn't existing infrastructure have an enormous impact on these development decisions? and doesn't the structure and amount of data you are managing also have a huge impact on this decision given php goes with relational database models and node.js favors object document dayabases?? ty again for your involvement!
David Carroll mongodb, an object document database model is in the MEAN stack with node. not mysql .... so one gets the impression that there's more support, experience, so forth with node and object oriented databases, not with relational databases and vice versa for php. I also think there is a lack of relational design among younger programmers who learn/understand the object oriented way of saving data....hence the nod goes to mongodb for them for data management.
Lisa F You bring up an excellent point about external factors that may play a role in such technology decisions. That said, I personally have never worked at a company where PHP was a primary staple for new development. It's been a language we've either inherited from another firm or was the language used by some open source project used by a client. I've worked quite a bit with WordPress, Magento, Moodle, SugarCRM, Joomla, and Learning Locker (before it was rewritten to NodeJS). More often than not, I've been involved in rewriting custom PHP projects into some other platform. One thing I do want to point out is that I completely disagree with the opinion that data storage requirements have any influence on using PHP or NodeJS. I've successfully worked with both types of databases in both platforms and never thought one DB was better suited with either language. Unless I'm missing something, I did notice this talking point on some websites that might be propagating this unfounded comparison.
Node. js is the best, for api's and all sorts of databases, i use node.js all the way, for my websites and api's
David Carroll really excellent summarization of the stack acronyms. thanks!
Thanks for help
I decided I go to node.js because I will make a stream website