4 ms·
I mean sure, PHP has a package manager and you can write software in it. But what compelling advantages does it have over it's competitors if you don't either h
by jrs95 8y ago
I mean sure, PHP has a package manager and you can write software in it. But what compelling advantages does it have over it's competitors if you don't either have legacy code or are primarily a PHP developer?
- Klathmon 8y agoIt's been a few years since i worked with PHP daily, but off the top of my head: * the shared nothing architecture is extremely easy to reason about (the world begins with a request, and ends once it's out) * shared-nothing also means it scales stupidly simple. Need to handle more requests? spin up more servers, on an almost linear scale, until your DB can't keep up. * it's pretty damn fast all things consitered * the barrier to entry is a fraction as difficult as setting up a backend with java or go or python (although setting up a LAMP-ish stack on windows for development still kind of sucked when i last did it) * It's probably only second to javascript when it comes to just sheer number and breath of 3rd party packages * backwards-compatibility is a huge bonus. I can be fairly sure that code I write now is going to keep working with minimal changes for the next decade (for varying definitions of "minimal") * developers that are comfortable with it are cheap and readily available (although this is changing for the worse lately) * it's simple. For the most part you don't need to worry about concurrency, about async requests, parallelism, callbacks, etc... Scripts run from the top to the bottom, and they do that every request. Sure, this is a massive drawback as well if you need those features, but PHP's "make it work any way possible" kind of ethos means that there are ways around most of those limitations that work really well... once you stop vomiting over how hacky some of them are in theory. It's not the most pretty, it's not the fastest, it's not the safest, and it's not the most "pure", but it is a glorious mutt that just keeps on trucking along, and I'm not ashamed to say that I really enjoy the language and I would gladly start a new project in it today if the opportunity arose.
- x0 8y ago>it's pretty damn fast all things consitered This is my favourite part of PHP. It really is fast. There's no server running all the time like a node or python website, on each web request it has to start up again and rebuild its entire state.
- Klathmon 8y agoThe bigger benefit is that architecture is so simple to understand. The world starts with a request and ends with the last byte being sent. No worrying about shared state, no worrying about multiple application servers, no worrying about crashes or blocking operations reducing performance for everyone, etc... It's just so simple that it let's you just focus on building something without worrying about all of the "software engineering" work that is all too often self-inflicted complexity.