10 ms·
For greenfield project main question would be why? It's not horrible but what do you exactly gain? With so many options around it's actually hard to make a case
by qaq 10y ago
For greenfield project main question would be why? It's not horrible but what do you exactly gain? With so many options around it's actually hard to make a case for PHP (and I have being using it since 2000).
- kowdermeister 10y agoI'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.
- abritinthebay 10y agoIt's extremely mature, stable, reliable, and easy to reason about. Personally I wouldn't choose it but, for a larger company, if you already have engineers that know it - and trust me many will - it's not a bad choice. This is especially true if you are just serving a simple website for a product or service, even basic e-commerce. 90% of websites out there don't need Rails, or Python, or Go, or Node.
- qaq 10y agoY but it's so slow to evolve it's just sad. We've being using hacked on "traits solution" since 2006 (via build script) and PHP only got traits in 2012 and on and on. A lot of things that could make it more modern get shutdown.
- abritinthebay 10y agoModern for the sake of modern isn't needed for a good app. Especially a web app. Stability, availability of developers, and ease of debugging however are important. PHP has those. Granted it's not the only one, and I think there are better alternatives, but it's really easy to write a good app in PHP. Bad coding practices and bad application design will make ANY app have bad code. PHP just historically had a lot of that.
- tomschlick 10y agoLaravel is a pretty solid alternative in PHP vs Rails.
- qaq 10y agoY but if I have a choice I'd rather not use either :)