The insane part of PHP is the actual language. It's an overgrown template language. Half the functions are based on C, half the functions are based on Perl. There's no regularity or consistency.
The benefit there is understanding. With PHP, knowing the C functions mean I understand how the PHP function works. The same with obj-c, I can drop down into C and work there. And the change in syntax, the way things works, helps me understand what is going on. Again, knowing C, I can do things in obj-c without needing to learn the obj-c part.
Maybe I'm one of the few, but context matters more than consistency. Maybe that's why I like vim.
Recently, a third half of it was based on Java. :-)
However, a lot of modern PHP frameworks(Doctrine, Symfony2) are quite nice to work with.
PHP: a fractal of bad design [1] lists many - really many - broken things for which at least I am unable to see how the behavior could not cause headaches let alone contribute to the success of PHP. Go ahead and read it - it is long but entertaining.
[1] http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-de...
There are some nice ideas in there, though. I dislike PHP-the-language as much as the next guy but sometimes you just need a three page website that you can hand off to a junior developer or web designer. If there is a language that does this, without being PHP, that would be awesome, but I don't think there is so I completely understand why somebody would just write three .php files rather than... install ruby, passenger, configure nginx, some supervisor script, etc. etc.
I think that Google Apps for Business + GAE services complement PHP nicely--now you can use that shell scripting core to tie together your data with some powerful APIs and basically have no operational worries. We'll see what they do with it. Maybe the next Facebook will start out as a three page website on AppEngine.
It doesn't matter if we're talking about PHP or JavaScript, or a web framework like Ruby on Rails, or various NoSQL databases, or even certain operating systems.
Even if people have used such technologies with some degree of success in the past, and even if they may still be using them today, it's important for us to move past them, as a community and as an industry.
Making their flaws widely known is a very good step toward moving to better technologies. So I encourage people to be vocal about their bad experiences, or about the flaws they see in technology. It's an important part of advancement.
Sorry if that's cliche, but your justification sounds more like it is rooted in your experience with badly developed programs, not so much a bad language.
I've been working with PHP for a long time. I've worked with other languages as well, but for the last 10 years career-wise PHP has been my bread and butter. And I've seen plenty of bad PHP as well, I absolutely don't deny that. As one of the most popular and most accessible languages out there, it's inevitable that lots of beginners will produce low quality code.
But I've also seen plenty of very good PHP code.
I've worked on quite a few large-scale PHP projects that were delivered on time and on budget, have maintained good performance under extremely high loads, and have had no security issues over years of time in production environments (including banking and automotive).
Want to know why? Because we wrote the applications properly, we tested them well, and we knew what we were doing.
I'm sure equivalent teams can do just as well with Java or .NET (or whatever else), but our stack expertise is with PHP, so that's what we choose because that's what we are best with.
Any tool in the hands of a bad craftsman will produce shoddy results. And as I said before, PHP's popularity is certainly a dual-edged sword, but I believe the good outweighs the bad...
So unless you can name some magical framework or language that can prevent mediocre or inexperienced developers from making mistakes or producing bad code, I think you're being narrow-minded and unfair in your criticisms..
Hating the players seems like a reasonable reason to avoid the game.
I've been writing PHP for 12 years... I've learned that its got flaws... Just like anything else... I've gotten over it... Why? Because I actually enjoy writing PHP. And nothing you or anybody else can say will change that, so just get over it. Use what's best for you, not what is the new hip thing to use.
I realize it's annoying for you, someone who enjoys writing PHP, to keep hearing people complain about PHP, but it's always going to happen. And although it won't convince you to stop using it, it will surely convince others to think about trying something else.
Simply put, they don't suffer from the many inherent problems that PHP suffers from. That means they won't catch anywhere near as much flak.
And your description of anyone pointing out PHP's flaws as being a "hipster" or doing it because it's a "new cool hip thing to do" is absurd. Many of us who speak out the loudest against PHP have been doing so since the late 1990s, and many of us are now well over 50 years old. We're about as far from "hipsters" as you can get, in just about every respect.
http://www.cvedetails.com/vulnerability-list/vendor_id-7252/...
Nope, no vulnerabilities in Ruby or Python, just PHP. Because PHP sucks, Ruby and Python and Erlang and Go and Java and C++ and blah blah blah blah blah are superior languages to PHP, blah blah blah.
Insert beating a dead horse image here.
Python 15 in 5 years
Ruby 36 in 7 years
PHP 341 in 14 years
No one claimed that other languages are flawless. Besides that the biggest problem are not vulnerabilities in the languages; the biggest problem are vulnerabilities in products build using the languages and PHP makes it especially hard to write correct code because of its many quirks making it (almost) impossible to be aware of all edge and corner cases.I don't mean major, fully-fledged app stuff, I mean simple CMSes, on-page loops / conditionals, <? echo $_GET["foo"] ?>, etcetera.
I'm no hardcore uber-coder, but I know enough to know there are languages I prefer to use than PHP. Personally, I like Ruby. But for a bit of quick glue or a relatively simple bit of web coding, I simply can't figure out what you'd use instead of PHP - and I assume from the number of "PHP sucks" comments that there must be such simple options?
Serious return question - who has requirements like that? In my experience CMSes are never simple, and I can't think what kind of site has the latter requirements, but only has those requirements and won't ever need any more functionality.
Personally I'd maybe use something like Django + the Flatpages app for a "simple CMS", and a tiny wsgi app for adding simple logic to a web page. Not, to be honest, because they're a perfect fit for those particular tasks but because I'd get to use a sensible language (python) that will remain sensible for the majority of other tasks (including non-web based ones).
Anything that's either focused on content or sales and either doesn't have a programmatic backend or hands off to another site will probably fall into the "not a full-fledged webapp" category.
If I'm running an A/B test on a landing page, for example, I just need logging code and a conditional to choose what variants to display on-page.
There's a lot of conditionals based on input conditions, too - "Hello, Hacker News reader!", redirects depending on country of origin, that sort of thing.
I'll also use simple snippets of PHP or Javascript on sites that are already using Wordpress, but there you're locked into PHP from the outset, of course.