+ 18

[SOLVED] Can we fully replace PHP with Node.js??

Can you tell me which one is better, faster, efficient and easier??

14th Mar 2020, 4:26 AM
Mohan
Mohan - avatar
6 Réponses
+ 9
Node JS has useful features like multi threading and so on but those using shared hosting servers can't use node so they use PHP. I am a freelance developer and since majority still prefer shared hosting. I can't let go of PHP in my skillset but then it depends on what you want to do. Organizing php files can get messy real quick on a large scale project bcos of problems like global variables. Most problems of PHO can be solved using franeworks like Laravel. So your question: Which is better? depends faster? node i guess efficient? depends easier? definitely php Edit: Most shared hosting servers don't support console so you might have to use php to run node
14th Mar 2020, 10:55 AM
Ore
Ore - avatar
+ 17
So if i make conclusion, NodeJS is faster because it has the multi-threading, and NodeJS is also said to be better than php, as in general. But if we see, which is easy and has lesser code, then mostly of us will say its php, and php has the in-build function to work with database, but js does not have that, js can have the Node.js framework to work with database, i also come to know about that we have Laravel framework for php which is very good choice. See, i did this comparison because my teacher asked me that u should now use database in ur websites, she said and showed me a code of php, also it was me that didn't like php because writing "
quot; again and again, i like js very much, i think its very beautiful and easy. I also found this lesson on sololearn: https://www.sololearn.com/learn/9660 Also i thanks everyone for their contribution in giving me answers.
7th Apr 2020, 7:17 AM
Mohan
Mohan - avatar
+ 8
Nope PHP cannot be fully replaced. Yes node js is better but in some cases PHP is still very helpful and better choice like making single forms and small projects. Since PHP supports Facebook and after PHP 7 it has a good future.
7th Apr 2020, 11:52 AM
Shreyansh
Shreyansh - avatar
+ 4
We cant decided which one is faster better and easier. It depends on the project you are using them in. I love php and node. Js..........
15th Mar 2020, 7:03 AM
Lady Kadashia = [T. I. K]
Lady Kadashia = [T. I. K] - avatar
+ 4
No, for a few reasons: 1: A lot of legacy projects use PHP. Replacing them would be WAY not worth it. 2: Despite me being a NodeJS fanboy, I gotta admit PHP really isn't THAT bad. 3: Programming languages - especially those as mature as JS and PHP - are *tools*, not "yes or no" things. Also, to clarify, NodeJS does NOT have multithreading. It's JavaScript, built on the same basic engine (the V8 engine) as front-end JS, and while it does take advantage of the event loop, calling it multi-threaded is just plain wrong. I'm also not entirely sure what he means by "shared hosting servers can't use Node". This sounds more like a particular shared hosting platform *chose* not to support NodeJS; not that shared hosting platforms in general cannot support it.
17th Mar 2020, 7:46 AM
HealyUnit
HealyUnit - avatar
+ 2
We know NodeJS coding is neater and a bit easier than php. However, php handles huge projects with ease, and it is secure if is coded properly. Also, php almost like C in syntax coding, because it was created from C itself. So, don't let the php $variable puts you off, to be a real programmer do not fancy a programming language over the other.
7th Apr 2020, 10:59 PM
ALi_Abdul
ALi_Abdul - avatar