6 ms·
PHP is actually a really decent option these days. And several libraries and frameworks built around it are flourishing.
by jonwinstanley 5y ago
PHP is actually a really decent option these days. And several libraries and frameworks built around it are flourishing.
- cies 5y ago> And several libraries and frameworks built around it are flourishing. Yes. > PHP is actually a really decent option these days. I beg to differ. What comparative options do you have experience with to base your claim on?
- Ronsenshi 5y agoI'm not the OP, but I have plenty of comparative experience working with Python and JS on the backend (node) and I find PHP to be a very decent option compared to those two. PHP has an amazing infrastructure of third-party libraries/packages around it, particularly if you're using PHP for web development. In comparison, Python simply does not have the same quality of framework for web like Symfony or Laravel. Django is good, but just that - good. And then there's the matter of speed with Python which is by all metrics slower than PHP. Then there's node. Node is significantly faster than PHP, but all that speed is wasted away because of all that nightmarish mess that is node_modules. Node infrastructure for backend web dev is nowhere near close to where PHP or even Python is.
- cies 5y agoSo compared to JS and $DYNAMICALLY_TYPED_LANG, PHP is "decent these days". These languages all suffer from very similar problems. Compare to C#/MVC.net, Kotlin/whatever, Go, Rust to get something noteworthy.
- thinkindie 5y agoAt least for Go and Rust, they have a much steeper learning curve. If you are a startup with limited funds you are not able to target engineers workings with those languages. If it's just a matter of speed, PHP already is good enough for the great majority of cases. The bottleneck is the data layer, usually. If your problem is being faster than the latest versions of PHP can achieve, you can certainly look for Go/Kotlin/Rust. But if you start your startup optimizing trying to shave off some milliseconds out of a response time you are setting yourself for failure. And in any case, languages like Go have their own part of quirkiness around the language or tooling (should we talk about how dependencies are managed in Go? that's ages behind npm/composer). Or shall we talk about the lack of exceptions, but then people regularly ask for them?
- norman784 5y ago> At least for Go and Rust, they have a much steeper learning curve. Agree about Rust, but I should differ from Go, as a disclaimer I never used Go, but read a lot of people switching from JS to Go and they have a very easy time doing so, maybe not everyone find it easy, and also it might to happen that the architecture you are used to work with in NodeJS is similar than the one that Go uses? > If you are a startup with limited funds you are not able to target engineers workings with those languages. I think Ruby/Rails will help you to build your project much quicker than Php/[Laravel | Symfony]. > If it's just a matter of speed, PHP already is good enough for the great majority of cases. Again also Ruby is pretty fast these days (if you want more speed you can use JRuby or TruffleRuby). > If your problem is being faster than the latest versions of PHP can achieve, you can certainly look for Go/Kotlin/Rust. Go: I should say yes, if PHP/Ruby isn't enough, this should your go to. Kotlin: I cannot speak about it, I'm not sure how popular is in this space. Rust: I love rust but I think this should be your last resort, if Go isn't enough anymore. But I can agree that work with Php is pretty easy (I worked with Php since 4.2 till 5.3, then tried it with some projects here and there with 7.x and 8.x) but I cannot stress how bad the tooling around php feels if you compare with others (ruby is bad too IMHO), JS with vscode, rust with rust-analyzer, etc. The only way I found a decent tool was with PhpStorm, but you need to pay for it (even the Laravel plugin needs a subscription), while the RubyMine is almost the same at least Rails works out of the box without an extra subscription for the plugins.
- mkdirp 5y ago> At least for Go and Rust, they have a much steeper learning curve. Yes for rust, not really for Go. I was able to pick up the basics of Go in less than a day, and the more advanced topics I was able to pick up not long after. OTOH I've tried to pick up Rust several times, and every time I just sit back in defeat. > should we talk about how dependencies are managed in Go? I'm curious what you're referring to here. Go's package management works, and is decent enough. No centralisation, and can work with just about any git repo.
- 9dev 5y agoHappily! - PHP gets you all the way from typeless prototype code to prove an idea, to expressive, runtime-enforced type checks that you can run in production. - PHP doesn't require static compilation, but can be configured to compile to efficient Opcodes on the first run, making it competitive with Java/Kotlin/whatever speed-wise. - PHP handles HTTP requests statelessly, starting with a blank slate in extremely short boostrap time. This pretty much eliminates memory leaks for common work loads. This execution model is very simple to reason about, and the major edge, I would argue. - PHP has an exhaustive ecosystem with a great package manager. All code is namespaced, fetched directly from the source repository (eliminating several security concerns), and usually of high quality. Common frameworks are mature, solidly built, and feature-rich. - PHP can also be used for other workloads outside of web applications: I've built a realtime message processing system handling thousands of messages per second, spread out across a dynamically scaling number of worker threads. It still happily processes messages as far as I know, and if you've ever received a business communication via messaging apps, chances are it was sent by my system. All of these things make PHP an excellent choice for a wide range of projects, even compared to statically compiled languages, which you seem so keen to compare a dynamically interpreted language to.
- jonwinstanley 5y agoThe main comparisons I have are building sites with Ruby/Rails and doing JS front ends attached to REST APIs. All three types of project have their own pros and cons.
- cies 5y agoThe fair comparison: PHP/Laravel to Ruby/Rails... How is PHP/Laravel better? I'm of the opinion it loses hard in every aspect.
- jacquesm 5y agoThere is one aspect where it wins hands down that trumps almost every other concern that you might have: availability of developers. This is a hard problem to solve.
- aeonflux 5y agoRaw number of developers doesn't matter at all. The ratio of offers to developers out there determines how easy the hiring actually is. I've tried to hire some quality PHP developers and it's as hard as Ruby/Python if not harder. First thing is, that you always get all the Wordpress people, who fixed one plugin and claim to have 10 years of PHP experience. Then you have to filter out all the 10 YoE who actually have 1 YoE done 10 times. For some reason all this is less of a problem in less popular stacks.
- jacquesm 5y agoIt does if the number is '0' vs 'some'. It usually depends on how and where you do your hiring. For those that only want to hire local developers it is very well possible that there are no local Rubyists, it is also possible that it is the other way around. Typically there are a lot more proficient PHP programmers than Ruby programmers around here, but if a company were open to remote workers the situation would right away change considerably. There is also the price factor to take into account. All in all, more often than not developer availability works itself into these choices.
- FinalBriefing 5y agoLaravel and its ecosystem is really great. I used to hate PHP, but now I find it quite enjoyable, at least in the realm of building websites. If you stick to modern versions and frameworks, it's a much different experience from PHP 8 years ago.