3 ms·
Node is actually one case where depending on the project it could be very easy to make a case for PHP :) if you need a simple API backend you can use PHP and no
by qaq 10y ago
Node is actually one case where depending on the project it could be very easy to make a case for PHP :) if you need a simple API backend you can use PHP and not deal with whole async thing.
- kowdermeister 10y agoActually for that project Node would have an advantage over PHP with job handling and realtime functionality. But currently I only care about a fast MVP.
- qaq 10y agoFor "real time" node def. will beat PHP :) But Elixir/Phoenix will destroy either one and thanx to BEAM it's actually can be considered soft real time system.
- alessioalex 10y agoUse whatever you are most confortable with then, be it Node, PHP, Perl or others. For an MVP what matters is creating it as fast as possible.
- qaq 10y agoVery true and with enough pain you can make anything work at any scale booking is doing fine running pretty much a monopoly built on perl.
- alessioalex 10y agoUse whatever you are most confortable with then, be it Node, PHP, Perl or others. For an MVP what matters is creating it as fast as possible.
- astrodust 10y agoNode's intrinsic ability to "speak" JSON makes for some very clean code when dealing with that sort of data. If you're doing a simple API back-end in Express with JSON in, JSON out, it's extremely light-weight. PHP, Ruby and Python here are at a disadvantage. JSON is JavaScript's home turf.
- krapp 10y agoPHP isn't at much of a disadvantage - it has its own native JSON encode and decode functions. Granted, actually using javascript is better but it's not as if you have to import a library or write your own JSON parser.
- astrodust 10y agoIt's not the decoding and encoding stuff, every language has that, but the difference in accessing the data. $data['key']['value'][0] is a lot messier than data.key.value[0]. Ruby has ways of mitigating this, but you pay a performance penalty.
- krapp 10y agothat's fair - your only options in PHP are array notation or arrows for objects, dots are much easier.
- astrodust 10y agoThanks to Perl that's used for string concatenation.
- qaq 10y agowell nicer syntax vs not dealing with event loop for me it's nicer to use more verbose syntax. (I guess I am getting tired of Node too :) all thanx to getting spoiled by Elixir.
- TazeTSchnitzel 10y agoThere's also $data->key->value[0], which is the default. But yes, dots are shorter.
- flukus 10y agoThere's a special place in hell for language designers that make you use shift that often.