Похожие чаты

Guys l have tried to use node.js but I still

cant understand it what makes it different from php? and can I use it with php?

5 ответов

7 просмотров

I didn't use nodejs but I'm positive it's much better than php

They both follow MVC if we are talking about laravel

Node is very different from PHP It has lively community creating awesome libs, easily downloadable and manageable using npm The language itself is constructed very differently in PHP, when you write an app, you write some code in a file, which becomes your route, and set up an external server which calls your php. In JS, you create a server in your code. You have full control over it from the JS level. PHP is synchronous — when you contact a database, or read a file, PHP waits until it's done. If you want to do many things at the same time (and you want), you have to use threads or processes. Whereas in Node, when you do anything which is not computation, ie. filesystem access, database access, http request, Node schedules it to run in the background, and proceeds to do other things in the meantime, which means one process can do a lot more, at the expense of being slightly harder to grasp than synchronouse langs (read about Promises and async / await tho, it helps a lot). And you can spawn multiple processes as well.

Node is a standalone program. It runs everywhere. PHP is _mainly_ a webserver module Node's primary goal is to execute javascript programs PHP main goal is to parse documents and execute parts of them them right before the web request cycle is done Node is a very broad environment, well suited for a lot of general tasks PHP is very tighly copuled with web execution

async everything makes it great How can you read two files at once in PHP?

Похожие вопросы

Обсуждают сегодня

Какой-то там пердун в 90-х решил, что есть какая-то разная типизация. Кого вообще это волнует?
КТ315
49
Hi. Do we have a raid bot? Why nobody doing raids on X? Even RH mentioned this and nobody paying attention...whats the channel for hex memes? If mods cant run raids just insta...
H
31
Подскажите, а есть vault lite или ченить такое?) А то нужен вольт для похода в вольт, но весит он ~500 мб) как-то многовато для парочки запросов ))
Alexandr Orloff
17
блеать, почему так?? где в роутере это исправляется?
Арсен Маньяков 🇦🇲
16
void terminal_scroll() { memmove(terminal_buffer, terminal_buffer + VGA_WIDTH, buffer_size - VGA_WIDTH); memset(terminal_buffer + buffer_size - VGA_WIDTH, 0, VGA_WIDTH); ...
Егор
47
🌊 Ocean Nodes Dashboard Update 🚀 Hey, Oceaners! First off, a massive round of applause 👏to all of you for the amazing engagement since we launched Ocean Nodes. In just a few ...
KreigDK | Never DM first🌊
3
Всем привет! Подскажите, пожалуйста, в чем ошибка? Настраиваю подключение к MySQL. Либы лежат рядом с exe. Все как по "учебнику"
Евгений
16
А можете как-то проверить меня по знаниям по ассемблеру?
A A
132
Здравствуйте! У меня появилась возможность купить книгу "Изучай Haskell во имя добра!". Но я где-то слышал, что эта книга устарела. Насколько это правда??
E
22
люди, которые используют flameshot, к вам вопрос. Можно-ли поставить хоткей на создание скриншота? В программе есть отдел "горячие клавиши", но там все для редактирования, скр...
ThunDer104
11
Карта сайта