6 ms·
This is such a surface-level article. Most of the things listed as advantages exist in other languages as well. Here are some actual reasons to like PHP: 1. J
by raziel2p 6y ago
This is such a surface-level article. Most of the things listed as advantages exist in other languages as well.
Here are some actual reasons to like PHP:
1. Java-like interfaces and classes and strict argument (and soon parameter) typing enforced at runtime
2. Autoloading and "lazy loading" of classes means defining bi-directional relationships between classes/types is painless (this can of course also make you shoot yourself in the foot, but I prefer that to dealing with circular imports in Python for example)
3. The deployment model is dead simple on a VM (with drawbacks, but by the time you need things like atomic deployments you've probably moved to containers anyway)
4. Statelessness
5. Performance (despite the statelessness!)
6. A very healthy package ecosystem, with several cross-framework interoperability projects
It has lots of bad parts as well, of course, but so does every language. And you may disagree with some of the things I listed if you don't like the particular feature or design, but that doesn't make them not advantages.
- mekoka 6y ago> you may disagree with some of the things I listed if you don't like the particular feature or design, but that doesn't make them not advantages Since the above equally applies to you, I suppose you're saying that these "advantages" are a matter of opinion.
- raziel2p 6y agoYou're right, probably the word advantage was a bad choice here. The point I wanted to make was that you might disagree with a certain feature/design but that doesn't make them invalid reasons for someone else who likes them to see them as advantages.
- orwin 6y agoHey, really good list, better than the article. I don't really like PHP, because of inconsistency (it tends to break to flow for me) (but maybe it changed since 2014), but php with strict typing is a big plus for me and php7 is already more than fast enough. I might try it again. The real issue i have with PHP is frameworks :/ Too much choice is a productivity killer for me.
- sascha_sl 6y agoI'd really love if we could just start over with the PHP base library design. There's just a lot of cruft that could be neatly packed into classes. For instance, the arguments for array_map and array_reduce are reversed, one takes the function as first argument, one the array.
- rd07 6y agoAFAIK, PHP 8 will support named arguments. I think that will make it easier to call built-in function without knowing the correct order of its arguments.
- chucky_z 6y agoSymfony
- raziel2p 6y agoCompared to what language? I don't think PHP frameworks are very different from other languages I've played with. Here's my framework guide: Slim if you're a minimalist and like doing things yourself, Laravel if you like convenience and are a quick learner, Symfony if you want to build something that will last 5+ years.
- TheCapeGreek 6y agoLaravel or Symfony. Laravel is far better for actually getting things to production quickly IMO. It's quite batteries-included but still lets you roll your own paradigms where you need to.