5 ms·
I'm currently hesitating between PHP and Node.js for a new side project and I'm leaning towards PHP simple because I could do it 50% faster due to my experience
by kowdermeister 10y ago
I'm currently hesitating between PHP and Node.js for a new side project and I'm leaning towards PHP simple because I could do it 50% faster due to my experience with it.
- qaq 10y agoNode 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.
- cloudjacker 10y agohmm, node has a lot less involved with getting up and running than PHP but you'll probably spend a few hours stuck with npm the first inevitable time a package doesn't work as expected
- qaq 10y agoWe run Nginx in front of both node and PHP so can't say it takes significantly less time to setup node then PHP for production use. Composer is a reasonable take (reapoff? :)) of npm. Yarn seams really nice though.
- tracker1 10y agoAgreed, barring an outside force, or other members with experience or a strong voice/drive, experience will be what drives most technology decisions, and should. I'd say the opposite, I can get a node project up and running pretty quick these days... as to peer comments on APIs, I don't think it's hard at all to spin up a react + node api project once you've done it before... and starting with a boilerplate for react+redux and express is very straight forward as well.