A
A
Alexander Dmitriev2018-08-02 18:44:58
JavaScript
Alexander Dmitriev, 2018-08-02 18:44:58

Is it relevant to learn nodejs for the backend or is it better to stay on php?

Good afternoon, I’m interested in web development and the question arose whether it’s worth learning php or node to build the backend part of sites, basic knowledge is enough here and there, I worked a little with laravel and slim, I felt node a little, I want to go through projects from the hexlet and I can’t decide with choice of direction. I heard somewhere that the node is starting to lose ground, and that it is not worth studying it, is it true or is it evil gossip? Thanks in advance

Answer the question

In order to leave comments, you need to log in

6 answer(s)
F
FanatPHP, 2018-08-03
@s_asha1998dmit

You need to learn programming.
All these questions, "Which car is better to learn to drive - Renault or Volkswagen?" - This is a kindergarten, honestly.
If for you the ceiling is a few dozen built-in functions of one language, then it's like learning - you can tinker a little on any.
The programmer thinks not in instructions, but in algorithms, patterns, data flows, object structures, message buses. In what language it is all implemented - not essentially.

L
latush, 2018-08-02
@latush

Learn Go, it is just now becoming fashionable)

A
asd111, 2018-08-02
@asd111

It does not interfere. Often there are projects where the main part is in php and a small part with web sockets in nodejs (for example, chat or alerts).
Javascript is evolving so nodejs is relevant for websockets. For ordinary sites, of course, it is almost never used.

A
Anubis, 2018-08-03
@Anubis

I can’t say which is better in terms of performance / resource efficiency in the “get an http request, send a response” scenario, but IMHO the node is at least more convenient. True, I have already lost the habit of PHP and have not written anything on it for 5 years.
As for the scenario "a constantly running application that can keep a connection and communicate with clients and other services in real time", then PHP is simply overboard.
Learn, you can't go wrong.

V
Vladislav Kopylov, 2018-08-03
@kopylov_vlad

"I'm interested in web development" - in your case, you need to take anything, but one thing and bring it up to a decent level. Ideally, there would be a community (friends, colleagues) nearby that will help and pull you up. After, taking a new language will not be a problem.

A
Alexander Filippenko, 2018-08-10
@alexfilus

A language, like a framework, is a tool, and different tools are better suited for different tasks. No one bothers to hammer nails with pliers. but why, when there is a hammer?
To say that Noda is worth learning, but PHP is not, or vice versa, is incorrect.
You just need to remember that JS is asynchronous and the running process hangs in memory all the time. And in PHP, the process starts, for each request, it fulfills and dies (I know that there are exceptions, but they require additional libraries and languages ​​​​were not conceived in this way).
Both of these approaches have both pros and cons, you need to decide which is more suitable for you.
And as mentioned above, all the backing is on PHP, and the sockets on the Node are quite a typical scenario.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question