3 ms·
It's still a language that's mainly used for web development, right? Modern websites in big companies require pretty complex backends that require data process
by f311a 5y ago
It's still a language that's mainly used for web development, right?
Modern websites in big companies require pretty complex backends that require data processing queues and other background activities. Can PHP compete with languages such as Go, Python or Ruby in the future?
- vaylian 5y agoWhy shouldn't PHP be able to compete here? I personally prefer Python over PHP for stylistic reasons but I have no doubt that PHP is capable of doing the same things as Python, even if the syntax looks a bit more outdated.
- f311a 5y agoBecause it wasn't designed for long-running processes or data processing at first. It evolved a lot, but I don't see it outside of simple backends for websites.
- The_Colonel 5y agoThat applies to Ruby and Python as well.
- f311a 5y agoNot sure about Ruby, but Python is a pretty popular choice. There are tons of open source projects that are used by big players for data processing and complex backends.
- The_Colonel 5y agoMight be used for that, but Python certainly wasn't "designed for long-running processes or data processing at first" which was your original argument. These 3 languages are pretty comparable in many ways.
- captn3m0 5y agoUnless you're doing matrix multiplications, PHP will work reasonably well. It's probably not the right tool for the job (because python's data ecosystem is too deeply entrenched in the ecosystem), but if your codebase is already in PHP, you can easily do long running processes in PHP (similar to how you'd write Rails jobs with ActiveRecord queries in Ruby).
- mschuster91 5y ago> It evolved a lot, but I don't see it outside of simple backends for websites. I'd say that something like MediaWiki, Wordpress or Drupal exceeds the definition of "simple backend". Personally, I even tend to write shell scripts in PHP simply because the language is far more sane than Bash (and god forbid naked old sh) and I don't have to fight whitespace with Python.
- f311a 5y agoWordpress is a complex project, but its backend does not require any background processing.
- mschuster91 5y agoIt does, even Wordpress has a cronjob - scheduled publishes, UGC postprocessing, IP ban expirations, there's a lot going on behind the scene.
- f311a 5y agoDon’t they trigger when a user opens a page?
- The_Colonel 5y agoIsn't it funny how (ba)sh always gets a pass and PHP is hated even though bash is a complete insanity?
- darthrupert 5y agoDoes anyone think bash is good though, like some people on this thread seem to believe about PHP?
- cies 5y ago> Can PHP compete with languages such as Go, Python or Ruby in the future? No. I expect no seriously large projects are started in PHP anymore.
- bovermyer 5y agoI'll take this comment as a genuinely curious inquiry instead of the veiled insult that others seem to be taking it as. PHP is primarily used for web development, yes. That doesn't preclude it from offline processing, however. It's quite nice for quick file processing scripts. Modern websites do not necessarily require complex backends. It depends on the site and its purpose. A minimal static site is just as modern as an ecommerce behemoth. Or are you using "modern" as a synonym for "complex?" PHP can compete with languages such as Go, Python, or Ruby in the right circumstances. PHP has a vibrant ecosystem that Go cannot (yet?) match. It has a different feel that may appeal to people that dislike Python's syntax. It can also compare quite well with Ruby, though Ruby on Rails and PHP on Laravel are almost similar enough to make that contest a wash.
- 9dev 5y agoTo provide an actual data point: I successfully built one of the largest messaging APIs using PHP. We had a horizontally (and dynamically) scalable architecture, ran hundreds of worker nodes in Kubernetes, that processed thousands of messages per second. The nice things about PHP were: * Interoperability with the rest of our ecosystem, including the web platform: We could share code and install modules in all projects * Availability of packages: For lots of common use cases, there are high-quality libraries available, such as process forking, socket communication, or message queues * Easy to go from PoC to production: Start out with no-brainer arrays, then move to typed data structures easily I find all the syntax critique on PHP to be completely irrelevant. It's a high-performance, dynamically typed scripting language. I can build the same things in it as with Go, Python or TypeScript, but the ecosystem is stable, tweaking it for production is easy, and it goes from "shoddy hackathon script" to "fully typed, production-grade application" smoothly. There's a single, pretty great package manager; type checking, although limited, works at runtime; code doesn't need to be compiled prior to running. All this makes it a good choice even for big projects to me.