Reputation: 614
Sorry, My question sounds dumb but i am bit confused about Node.js .I am a PHP developer and i know that php has operations and functions that execute on server and return result to client screen.
I want to ask in clear words, Do Node.js/Express.Js does the same as PHP does? Do Node.js is for same work as php is?
should i move to Node.js from PHP (if both are for same purpose {mean back-end purpose})?
Which one is better choice in sense of Speed and security?
Which one has better scope in future?
Please help me in sorting out this confusion.
Please donot degrade my question.I a new in programming and answer in simple words as well...please please please.
Thanks.
Upvotes: 2
Views: 1066
Reputation: 1525
Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient. Node.js' package ecosystem, npm, is the largest ecosystem of open source libraries in the world.
Express is a framework that is built on top of Nodejs
This is a popular content that compares Node and PHP
.
Upvotes: 1
Reputation: 201
Moiz. You are asking sort of very generic questions, but maybe they can have simple answers to help you keep studying.
Node.JS is an asynchronous Javascript runtime. Yes, it can run as back-end code. Please, read their docs: https://nodejs.org/en/about/
1) Generaly speaking, yes, Node.JS can do the same work. They have different approachs and different architectures.
2) The answer is no if you are asking just to be on the curring edge. Move to another language is something that you have to study and really know which are the reasons to switch from one to another.
3) The answer of this question is the same for all languages comparition: depends (project, architecture, needs, etc, etc, etc). Is always good to enforce that speed and security is more accountable to developers than from the language itself.
4) Both are being improved and updated.
Upvotes: 3