Похожие чаты

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 ответов

8 просмотров

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?

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

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

Всем привет! Имеется функция: function IsValidChar(ch: UTF8Char): Boolean; var i: Integer; ValidChars: AnsiString; begin ValidChars := 'abcdefghijklmnopqrstuvwxyzABCDE...
Евгений
44
For all those that keep asking why no pump? why this ? and why that...? Please close ur ewt chart and open 2 others - TOTAL (total mc) and BTC.D (btc dominance). Maybe BTC a...
Inn3r_G
19
"Since pnut can flip FTM easily, I'm swapping my FTM to pnut and hoping for a easy x5-x10" Perfect recipe for disaster. NFA but chances are, you'll end up as exit liquidity ...
C. A.
7
AMD status update? No longer in the plan but something might be around the corner later on Chinese partner? No longer in the plan. This market does not seem to be the top ...
Ben
6
да кстати заметил всюда почему то всех сюда прёт, ни в одном чате столько ботов не прёт как сюда.. Может чота надо доработать?
REDis
15
I get confused when people talk about the ‘bull market’ and the ‘next bull market’ as if anyone really has a clue what’s really going on in the world. First of all - there i...
Shah
1
Ready for some fun AND a chance to win TKO Tokens? Join us for exciting minigames in our Telegram group! 🕒 Don’t miss out—games start on today 25 October 2024, at 8 PM! Ge...
Milkyway | Tokocrypto
255
> Копаем глубже > Следующий момент был, когда я спросил его, знает ли он JavaScript. Он ответил, что его учили работать с C#. Я тоже в университете писал на C#, но даже там мн...
Oleg Volkov
4
Добрый день, подскажите, пожалуйста, по проблеме. Сегодня на работе утром обнаружилось что по рдп подключиться не получается к серверу 2022. В серверную зашел - на системно...
srv
19
Всем привет, я тут короче оторвал кусок от рут-раздела и сделал свап, перезаписал fstab, загружаюсь и меня перекидывает в дебаг-шелл. Вижу ошибки бтрфс: Device total_bytes sho...
&[SirJiga] Jiga
9
Карта сайта