Hacker News new | past | comments | ask | show | jobs | submit login

Every time there's a story about PHP there's a comment like yours, and then in reply there's a comment like mine:

Yes it's perfectly fine to use PHP if it's a productive environment for you. Of course it's possible to write good software with it. Of course a skilled developer will manage to do great things with sub-standard tools. Many extremely popular websites were and even still are powered by PHP, that's undeniable.

But that doesn't mean that we should absolve PHP of all its many, many design errors over the years. There were for a long time many fundamental issues with PHP as a language that didn't exist with its peers. The language was not so much designed as it was cobbled together by amateurs starting from a half-backed templating engine.

I'm not saying that to hate on PHP, I just believe that it's important to learn from your mistakes if you don't want to end up reproducing them. It's important to acknowledge the many failings of PHP even if many of them are now ancient history.

This revisionist stance that there was never anything really wrong with PHP and it's just Lispers who hated on the language because it was popular and beginner-friendly and they didn't know what they were talking about is simply, factually, provably untrue.




> This revisionist stance that there was never anything really wrong with PHP

This strikes me as a strawman. PHP spent years being a generally loathed language for reasons that at this point aren't really worth reiterating.

But, in an analog to Javascript, it has made progress, grown up and become a better language. One of the best? Like Javascript, no. But serviceable at worst.

I stopped earnest work in PHP ~ 5.7. I dabbled with HHVM, but eventually moved most backend/server code to Go and moved on with my life. But PHP 7+ has been a big step up, at least from my current vantage point.


>This strikes me as a strawman. PHP spent years being a generally loathed language for reasons that at this point aren't really worth reiterating.

This story is called "25 years of PHP" and the parent starts their comment with "I wrote a lot of PHP from 1999-2008". In this context I think it's fair to remind people of the many... controversial choices the PHP developers have made (or, maybe more accurately, stumbled upon) especially early in its history.

I certainly hope that most of these earlier flaws have been addressed, and I'm willing to believe that modern PHP can be a much better language to work with but that doesn't mean that we can say that criticism wasn't ever warranted. Lest we forget this is a language that once shipped a function called "mysql_real_escape_string" and saw nothing wrong with that and a tertiary statement whose precedence works backwards from any other language with a similar construct.


Really, though, who denies the language has a very bad reputation? A lot of these decisions were questionable, but explainable, like mysql_real_escape_string coming from the MySQL C code itself.[1] that doesn't excuse it, but it explains it.

[1] https://dev.mysql.com/doc/refman/8.0/en/mysql-real-escape-st...


My point is that it's not an undeserved reputation, there were many real problems. That's what was being challenged.

And the idea that it was reasonable to ship paper thin wrappers around a C API in a high level scripting language is one of the many problems that used to plague PHP. You could even get it to segfault with certain APIs because they would basically just call C completely unchecked. You also have functions having "out parameters" because the underlying C function does, even though PHP has multiple ways to return multiple values. I could also point out how basically every PHP subsystem had its own set of functions for error handling instead of having any kind of unified error system.

MySQL itself having made very questionable choices around the same era (and PHP and MySQL walking hand in hand) definitely doesn't help either, I grant you that.


Javascript has made progress too. While far from perfect and I think PHP's journey started at a worse point has has gone further JS certainly is a lot better now and the major failings of JS are of it's ecosystem and not the language itself.

I also think that both JS and PHP get a lot of flak for maintaining backwards compat as far back as they do. You can run a lot of webapps (frontend and backend) from 10-20 years back in modern PHP and browsers which is pretty amazing. I'd like them to have a modern mode (like the proposed p++/<?php2020 and modules for JS) we should still acknowledge that maintaining compat that far back is not easy.


If you don't do that, you get the python 2 to 3 transition. Which is still going on.

PHP did drop some stuff between 5 and 7, but all of it had been marked deprecated for some time prior (often years).


> Javascript has made progress too.

To be clear, this is what I was saying when I called upon it as an analog.


Ah, then I misunderstood. Thanks for clearing up


No one is claiming that PHP is and/or was without fault. The sentiment is that we built things that worked despite them.


That's not being fair. There are many comments on HN of people saying exactly that PHP just isn't bad. The grandparent reply even says:

>My only real gripe with PHP is the annotation syntax.


I never said it was the only problem with the language. I said it was the only one that really bugged me. You're more than welcome to attack my opinion of PHP (which seems like a silly thing to do, but you're welcome nevertheless), but please don't put words in my mouth.


The parent comment claimed that PHP's former sins were being absolved. The quote you are referencing is about the current state of PHP.


The parent comment to mine, though, said:

> No one is claiming that PHP is and/or was without fault.

I'm emphasizing the "is" part. "No one is claiming that PHP is without fault."

My comment is asserting that there are definitely people who say that PHP is not bad. I did not speak to whether anyone claims PHP was never bad.


Well let's be clear ... "bad" is a little more subjective than "faults," which can at least be qualified.

By some measure, every language has warts. PHP in 2008 had a ton of them. PHP in 2020 has fewer of them. Which is a lot like JS.


But if PHP in 2020 still has a TON of warts and other languages (even ones with large ecosystems) have WAY FEWER warts, does it matter if PHP has improved since 2008?


Again, I stopped messing with PHP at 5.7 and have watched 7+ grow. My daily language is Go, which I like a lot. Had or have runs with python, asp!, Perl, c#, node, delphi and used rust and Java for personal projects.

I can find warts in all of them. At one point I'd have put PHP right above JavaScript and ASP down at the bottom. Now? I don't see it. Legacy issues are still there, like inconsistent standard library function names, but otherwise I don't see it - as a whole - as any more 'warty' than most of those.


I should have known better. My apologies, the person simias is replying to is not saying that PHP is without fault.


From a language design perspective, you're absolutely right. I started with PHP 3, shortly before PHP 4 was released. 4 and 5 were major improvements over 3. And sure, a lot of cruft remain(s|ed). And there are definitely things that could be better. But overall, it's a pleasant language to work in.


[flagged]


Please don't take HN threads further into programming language flamewar. That's one of the things that destroyed earlier internet communities, leading to the founding intention of this site [1], which is not to turn into scorched earth [2] or at least to stave that fate off for a while longer [3].

[1] https://news.ycombinator.com/newswelcome.html

[2] https://hn.algolia.com/?dateRange=all&page=0&prefix=false&qu...

[3] https://hn.algolia.com/?dateRange=all&page=0&prefix=false&qu...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: