Just asking: why do most programmers dislike PHP?: Interesting debate over at Reddit about why PHP is “disliked” among “most developers” (the veracity of that last sentence is up for debate).
Lots of good argument, including this fun rant:
PHP been hacked together in a half-assed way by a community of probably smart but unorganized or inexperienced people who have collectively catered to the absolute laziest crop of developers who think that using a shitty language every day for many years is a good tradeoff for the few days they’d have to spend learning to set up something better than the Fisher-Price crap that’s already on their web host. PHP has no known advantage other than being the path of least resistance, which is a strategic advantage but of course not an actual advantage.
I could get into specifics, but the best way to tell it is that from experience with many languages comes the conclusion that PHP is horrible from an intuitive sense that is more than the sum of the individual flaws with it. Not that some of those flaws aren’t big, but it’s important to note that these flaws add up to a culture of poor quality that feeds back on itself.
Your time with PHP is one compromise after another, and for some reason I’ve never understood there are apparently many people who learned PHP as their one language, cling to it, and defend all of its flaws instead of seeking out better languages, a category into which most of them fall.
You can replace the word PHP with MySQL and this post is still accurate. Half of the old “LAMP” is dead and Python and PostgreSQL are the future.
Count me unimpressed by that tirade. I wish he had gotten into specifics instead of telling us about "intuition" and "gut feeling."
PHP has faults and it is certainly cobbled together. But it obviously caters to a pretty broad base of need, and is readable enough that people can get things done with it. And what are the alternatives in this space? Cold Fusion, ASP, JSP -- and if you stretch, Perl and Ruby. Almost anything you say about PHP you can also say about four of those five, and Ruby suffers from performance issues. In that company PHP stands out as a pretty decent language all around.
Agreeing with John. I would like to hear what languages these people are using in it's stead. If someone is using the "perfect language" out there, it hasn't been released to the general public.
As for the guy that suggested postgreSQL over mySQL...really? That's just laughable.
Everyone's entitled to their opinion but the "Language is the problem" stance has long been disproved. Ada, a perfect example of type casting H$ll, can be used to created utter crap. Having used CF back in the day, I found it to speed dev time greatly. When our budget got cut, the idea of setting up LAMP in a short period of time for zero dollars fit the bill.
On a personal note, I'm not an OO expert by any means so Python is not something I have taken too. While PHP and it's functional aspect bring me back to my days of Matlab and such.
Use what works best for you.
I'm paid to write PHP everyday. I absolutely despise the language, but it gets the job done. In a large project with tons of legacy code (i.e. code written before the project grew large), PHP quickly devolves into a unmaintainable mess of globals. A developer can unwittingly break code in other files by colliding with global variables, and tracing the origin of a given global value can be a nightmare.
Python, Ruby, and Java don't suffer from this problem. "Globals" don't exist in these languages. Every variable, function, class, and constant is scoped to the current class or script. If you don't explicitly declare or import something, you don't need to worry about it.
As for Chris and his laughing about PostgreSQL, he's mistaken. PostgreSQL is superior to MySQL in every respect but market share. That includes performance, MySQL's traditional strong point. PostgreSQL is a textbook example of successful scaling on multiple cores. MySQL collapses in a mess of bad multithreading under the same conditions.