What to choose for the web service, PHP or Node.js?

Good day!
Think of one idea to make a web service, but can't decide between PHP and Node.js. In fact the main action will contribute to take from the database, to give a few static pages(though they should be separate frontend). Sam learn PHP, but they say this case is better Node.js.
I would like to know your advice, thanks in advance.
March 23rd 20 at 18:41
3 answers
March 23rd 20 at 18:43
Better use what you understand in one way or another. So I would advise you to write in PHP, and simultaneously learn nodejs.
With learning PHP would finish to start) - hassie commented on March 23rd 20 at 18:46
@Lyndon, then do not spray. It is dangerous for efficiency. Learn PHP, write web services in PHP, admin, classes, read the documentation. look for tutorials on YouTube whole playlist. Get the basics look for some tests on the line later will feel uverena in PHP, see the work of HTTP, HTTP, TCP/IP, FTP, SMTP protocols. Next, go to framwork suitable for classical style OOP Yii2 using the MVC pattern. Speaking of patterns, if I'm not mistaken about 23. Is too to know. Books on design of the app will make your thinking more correct. Next come database. Try to start with MySQL. Build simple queries, once we understand what is normalization, and optimized queries, go to the sql functions, subqueries and PostgreSQL to try. And so on....

But don't forget about the official documentation, there is also a lot of interesting writing. Try first to understand it, and only then in the tutorials to run. - Kiarra34 commented on March 23rd 20 at 18:49
@Kiarra34, well, thanks for the tips. I want to add https protocols, https, tcp/ip,ftp I know, writing a couple of projects on laravel, you know SOLID GRASP and work with sql(usually the orm). In any case, thank you) - hassie commented on March 23rd 20 at 18:52
@Lyndon, In my opinion if you are already familiar with all of this promising to do node.js one language on the server and on the client, many advantages, is himself a former PHP developer now with node/react. - florencio.Wisoky23 commented on March 23rd 20 at 18:55
@florencio.Wisoky23, then you completely SAUGUS. But I think you should work on PHP, we are given to understand some truths. - Kiarra34 commented on March 23rd 20 at 18:58

Next, go to framwork suitable for classical style OOP Yii2 using the MVC pattern.

Already out of date. Not supported. - Curtis_Quitz commented on March 23rd 20 at 19:01
March 23rd 20 at 18:45
Node.js more bright and promising than php. The main advantage of node.js going beyond the browser and server, that is, for example, you can connect the microwave or refrigerator to your network, if necessary, the PHP has no such opportunity. Therefore, I recommend to focus on node.js and yet to work in the system you know best.
And it's interesting, about the fridge, thanks for the interest googling about it) - hassie commented on March 23rd 20 at 18:48
Here is an example of such a refrigerator four years ago https://blog.ubuntu.com/2015/05/11/iot-canonical-a... - florencio commented on March 23rd 20 at 18:51
Utter nonsense - gertrude.Moen commented on March 23rd 20 at 18:54
@gertrude.Moen, why would это?@gertrude.Moen why? PHP but to return to the server and generate pages in the browser nothing can. He even the name speaks for itself - Personal Home Page and node.js this is a continuation js in a batch variant, it already has ready-made modules to perform particular tasks, which greatly simplifies the work by js. Enough to see how it works gulp, webpack, grunt at worst, moreover, ........ Node or Node.js — software platform, based on the engine V8 (a JavaScript to native code) that turns the JavaScript from the highly specialized language in a General purpose language. Node.js adds the capability of JavaScript to communicate with devices of I / o through its API (written in C++) to connect other external libraries written in different languages, providing challenges to them from JavaScript code. Node.js used mainly on the server acting as the web server, but have the ability to develop on Node.js and desktop Windows application (using NW.js, AppJS or Electron for Linux, Windows and macOS) and programming microcontrollers (e.g., tessel and espruino). Based Node.js lies event-oriented and asynchronous (or reactive) programming with non-blocking I/o. I SEE NO reason to TOLERATE the FACT THAT SOMEONE is too LAZY to READ at least on WIKIPEDIA, I'm not even talking about the website Node.js. - florencio commented on March 23rd 20 at 18:57
@Joel, that's all that you have written, shows your complete ignorance of both technologies. - gertrude.Moen commented on March 23rd 20 at 19:00
@gertrude.Moen, old article https://habr.com/ru/post/273259/ , I see no reason to respond to provocations. - florencio commented on March 23rd 20 at 19:03
@Joel, the quality of this stateiki possible ratings to determine. Cons usually only the trash of a type similar articles.

There are even examples of incorrect: people are not just poor knowledge of PHP, but also compares the performance of different programs (multi-process helloworld in PHP with asynchronous on the gcd). - gertrude.Moen commented on March 23rd 20 at 19:06
@gertrude.Moen, In some ways you're right, and he does not need to know it - why do we need PHP, you can implement all on a ready node modules, and what is not possible is to add a couple of lines of code in a different language, including on a priority JS. That article is ancient as mammoth, the development is not in place. In node only one problem - it all turns to mush in one single stream of numbers and when an error occurs, for instance among thousands of the returned queries are merged into one pipe is sometimes difficult to find what is not working properly, where there was a failure. Other than that, no cons. PHP with this mission, just shut up and hosters will fuck for load even with TOP hardware, but the stability "of SOKO". Node itself only accelerates the development of almost any task that is important today. Where you can find the PHP Facebook for example, or Wordpress, they are the only reason he's still afloat, and it is about the audience, 70% of people on the planet. For fun try to load the page Facebook on PC, then accomplish your goal have you yet to drink a Cup of coffee or tea while he waited for her full download. - florencio commented on March 23rd 20 at 19:09
and the hosters will fuck for a load
as if hosting is unprofessional segment of web developers, for engines that put webmasters.
Developers usually VDS and the lack of constraints under its iron

Further, there is a PHP for ReactPHP, which is the alternative Node.js
And it is necessary to compare similar solutions. - gertrude.Moen commented on March 23rd 20 at 19:12
@gertrude.Moen, Again I agree to an extent, as the problems are different, sometimes you have to optimize that only established, respectively, in the optimization involved and the hosting, have a look what speed, what load, how many resources while it is eaten, it is possible to know the peak load which can withstand the website, of course it's not for beginners. Again, a powerful argument in favor node.js it is primarily up to javascript through which you can design not only for web but also for various devices. Today development is the fact that gradually all the surrounding devices are slowly sucked into the world wide web, such as cars, smart home, instrumentation, outdoor advertising, etc., etc.. Again, one JS not enough, but thanks to the extensibility node.js much the impossible becomes possible. In General, it is sufficient to look at the rating, the difference is minor, but it is clear the rapid decline in the development of PHP over the last ten years https://tiobe.com/tiobe-index - florencio commented on March 23rd 20 at 19:15
Again, a powerful argument in favor node.js it is primarily up to javascript through which you can design not only for web but also for various devices.
PHP can be used for internal enterprise projects with complicated business logic and minimal web interfaces. And this is the most interesting (in my opinion) and one of the most popular usages. This is just the most complex monolithic projects in the tens and hundreds of man-years.
Noda's not up to it. - gertrude.Moen commented on March 23rd 20 at 19:18
@gertrude.Moen, Also a controversial issue, the node also works great with logic and with the same button, you can cram a lot of performance options depending on the conditions, but I wouldn't use if in your project, cycles very, very slow, and would do the constants for the interrupt, the transition to another line of code in case of discrepancy between constants and at the end of the passage, matched and used constants would your scenario of the matching constants. It turns out one request to the server for source code, testing of the algorithm on the client side and accordingly, the testing scenario perform tasks based on that chosen by the customer. However this applies closer to js, but in conjunction with the node in the case of complex logic, when worked through a number of operations on a single click, again it is desirable that they are implemented on the client side, so while he thinks all the modules of the script was already loaded on its side. Moreover, under each individual task, you can write a node module that is Oh how easily you can move from project to project. The significant difference in the choice of programming method SOP and OOP. The event-driven method significantly outperforms object-oriented programming. Hence, fine scaling to epic proportions, just look at the number of browser games. - florencio commented on March 23rd 20 at 19:21
The event-driven method significantly outperforms object-oriented programming.
A picture with an indignant Jackie Chan seen on the Internet?
All the drum that the cycles are slower. In the corporate sector most importantly - support costs in the long run. - gertrude.Moen commented on March 23rd 20 at 19:24
@gertrude.Moen, I wouldn't say that if it was true, Google would be the ass with their innovations, but for some reason he is the leader. Demands on staff are rising and the Holy place is never empty, if we talk about the corporate sector. As a freelancer, when a client needs a small website or a shop on WP, then I absolutely agree, there requirements are low. In the studios as well, but not in corporations. Accordingly, the wages are much lower and more volatile in the studios and as a freelancer, if to take for a long period with the same effort of labour, than in a large Corporation. Just look at Samsung, when their website crashed due to load almost at the crucial moment, was slightly miscalculated the load. Simple tasks are easy enough to Google, challenging, require much more time and effort to implement. - florencio commented on March 23rd 20 at 19:27
March 23rd 20 at 18:47
Do not advise anyone php. Let him die in peace. Examine the Flask, then Django and is guaranteed to be rich and happy future 20 years.
And you can read more than a bad tag? - brooke commented on March 23rd 20 at 18:50
He will not die :) - Kyla.Upton commented on March 23rd 20 at 18:53
@brooke, blocks the slow statless and much more - Vida commented on March 23rd 20 at 18:56

Find more questions by tags Web Development