5 ms·
I get downvoted when I say anything remotely negative about PHP, in threads devoted to PHP, but perhaps my thoughts will make sense if I emphasize that I used t
by lkrubner 9y ago
I get downvoted when I say anything remotely negative about PHP, in threads devoted to PHP, but perhaps my thoughts will make sense if I emphasize that I used to love PHP. It was my first real language, and I built my first business around it. That was in the year 2000. That was in the era before modern package managers, when PHP's huge standard library was a tremendous benefit, because the alternative meant using something like Perl, where you had to download every module from CPAN and cobble it together yourself. PHP was a dream compared to that.
But 18 years have passed. Every language now has very good package managers. There is an abundance of dynamic languages, most of whom are more consistent than PHP.
I'm not going to waste your time with a long PHP rant. I just hope that everyone is aware that the huge benefits that PHP offered in 2000 are no longer valid. If you are programming in PHP, you owe it to yourself to explore some of the many options that are out there. There has been incredible innovation among software languages since 2000, but PHP has mostly tended to follow a conservative path, mostly imitating Java.
For anyone who won't be bored by another PHP rant, I wrote my thoughts on this subject back in 2014:
http://www.smashcompany.com/technology/why-php-is-obsolete http://www.smashcompany.com/technology/why-php-is-obsolete
- wolco 9y agoA lot has changed since 2014. PHP 7 is blazing fast, frameworks like laravel are putting the joy back into rapid development.
- lkrubner 9y agoLaravel has been around since 2011. PHP 7 is slow and continues to perform badly in all reasonably done comparisons: https://www.techempower.com/benchmarks/ https://www.techempower.com/benchmarks/ But even if both of your points were true, the point is to look at what is happening in other languages and frameworks. Every day you spend learning about PHP is a day that you are not learning about the languages that are really moving the industry forward to interesting new places. Ask yourself, honestly, how many interesting new ideas will you learn from studying PHP, versus the more versatile (as in more platforms, and also the frontend) languages such as Javascript/Node, or the more innovative such as Go or Rust or Clojure or R or Julia? And I'm not even mentioning the more experimental languages, such as Shen or Lux.
- CiPHPerCoder 9y ago> But even if both of your points were true, the point is to look at what is happening in other languages and frameworks. Every day you spend learning about PHP is a day that you are not learning about the languages that are really moving the industry forward to interesting new places. Which of those languages give you NaCl out of the box?
- userbinator 9y agoEvery day you spend learning about PHP is a day that you are not learning about the languages that are really moving the industry forward to interesting new places. I continue to be baffled by this sort of "novelty-chasing" --- do I really care about "interesting new places" or "interesting new ideas"? No; and in fact I'd rather not, because it takes time and energy away from actually solving useful practical problems, besides the ones you create yourself in chasing after the latest cruft. PHP is slow on an absolute scale, but chances are that a minimal, straightforward application written with it can perform better than something with a bloated framework on top in a different language. That takes true skill and experience, not something you can get if you're continuously jumping around trying to chase the fashion trends. As someone who has witnessed several major trends in programming come and fall, the amount of churn (and encouragement thereof) in the web community is astoundingly unsettling. "It's not about the tool, it's how you use it."
- lkrubner 9y agoMaybe you don't realize this because you haven't studied them, but "bloated framework" is unknown in Go or Clojure or Rust. Each of these languages tends towards minimal frameworks. Clojure, in particular, is known for its composeable libraries which make frameworks a bit of a sideshow for that community. Go is known for having enough in its standard library that some aspects of frameworks are not needed. About this: "because it takes time and energy away from actually solving useful practical problems," You can not know that without first studying other languages. You might find that you are 10x more productive in Rust. You can only find out by studying Rust. But you bound the conversation in ways that I didn't when you write: "in the web community" I feel that developers can learn a great deal if they study projects that don't necessarily have anything to do with Web programming. Nothing in the article or on this page necessarily restricts us to only considering Web programming. "It's not about the tool, it's how you use it." I wouldn't use a hammer to go fishing. Nor would I use a saw to turn a screw. Nor would I use a frying pan to tune a piano. It helps to learn about a lot of different kinds of tools, because over the course of your career, you might be confronted with diverse tasks.
- cutler 9y agoFor me the biggest non-starter with PHP is the abuse of doc comments and annotations as well as the sheer waste of space which has now been blessed in PSRs as the idiomatic way to write "modern" PHP. This same modern PHP often fills a full screen with only a few lines of real code. You could be forgiven for concluding that someone influential in PHP-land is trying to out-Java Java. PHP is a waste of space, literally.
- esistgut 9y agoWe evalued PHP for a GraphQL/REST backend and we found some really good points: the design of Symfony, the ACL system, the huge productivity gain of API Platform (https://api-platform.com/ https://api-platform.com/). In the end we discarded the whole stack anyway because of the heavy use of docblocks annotations which made our test code hard to read and hard to debug.
- Lazare 9y agoYour comments are very valid for 2014-era PHP, but I'm not sure you understand how much PHP has changed. The benefits PHP offered in 2000 are no longer valid because those are table stakes, absolutely. What about the benefits PHP offers in 2018? > There has been incredible innovation among software languages since 2000, but PHP has mostly tended to follow a conservative path, mostly imitating Java. PHP fans like to point out (tongue slightly in cheek) that PHP is the first major language to add modern cryptography to its standard library (libsodium in php 7.2). We can argue about how important that is, but it's also not wrong. And it certainly didn't copy that from Java. :) Further, I think some of your criticisms in the link have also not aged well.
- developer2 9y agoBecause every time someone rants against PHP, they do so in the same way you've done, saying things like "If you are programming in PHP, you owe it to yourself to explore some of the many options that are out there". All you do is insult the language, and subsequently, the intelligence of those who continue to use it. Many of us have looked at - and heavily used - other languages, and choose to come back to PHP for many (not necessarily all) projects. Your assumption that we're all morons who program in PHP because we're too stupid to try other options is misplaced. You looked elsewhere and preferred what you found. Good for you. Some of us who looked elsewhere found that every language has its faults, and that PHP does the job just fine. Particularly since the performance improvements in later PHP 5.x versions, and finally the leaps and bounds gained in PHP 7, the language is more than good enough for most tasks. I've done projects in C, NodeJs, Ruby, and yes, even Python. Python fanboys in particular seem to think their use of the language is an indicator of superior intellect or programming ability. The whole "I am smarter/better than PHP developers" gag is really, really, old.
- wwweston 9y ago> Every language now has very good package managers. Not sure if composer is "very good," but it's generally worked out better for me than gem. (Also, package managers are not an unqualified benefit. I like them for installing things I'm not developing, but as far as I can tell they essentially defer a legibility cost for developers. Sometimes worth it. Not always.) > There is an abundance of dynamic languages, most of whom are more consistent than PHP. I think it was Ralph Waldo Emerson who had some choice words about consistency. And this criticism has always rung a little hollow to me. I'd agree that some of PHP's dynamic multi-paradigm scripty siblings feel cleaner, but having written code in many of them, it's never felt like a major difference in productivity to sometimes have to pause and consider argument order or precise names. The lookup cost has always seem cheap on on par. > I just hope that everyone is aware that the huge benefits that PHP offered in 2000 are no longer valid. There's definitely a closing in the benefits gap since 2000. PHP is far from my favorite language. PHP is not right for many projects. There are still some benefits that PHP prioritizes that I think arguably aren't done better elsewhere * Trivial deployment story. Your app is one or more files. Drop it in a directory on a wide variety of hosting environments. You're done! (Buuut, if you want something more involved, lots of choices available there too. * The language is the template language (though there's other options). Some people consider this an anti-feature because it allows amateurs to build ill-organized applications around a dynamic-document-as-program paradigm. I think that's still a brilliant gateway that makes the marginal cost of moving from a static document to a dynamic one small while still allowing an easy transition to front controllers. And it means the templating performs at parity with the language itself and can do as much as the language can do. Pair it with a simple routing library and model layer and it's as easy to build something reasonable quickly as it is with comparable Python & Ruby frameworks, often with fewer moving parts and similar magnitude of performance. So sometimes when I have smallish web-facing projects (or projects I think I might want to distribute for others to run on the web), I still often find myself reaching for it, even with plenty of other options at hand, even with languages I like better.