Why PHP is bad

Joined
Apr 9, 2004
Messages
3,824
Reaction score
746
I have no objection if anyone wants to use PHP and is happy with it so please do what suits you. However several times has it been asked here why PHP is said to suck, most recently just a day or two ago so here's rather factual article about design flaws in the language that I happened to be linked to in a discussion about something else. Just kidding, it was the same topic.

PHP: a fractal of bad design - fuzzy notepad
 
php may not be the best language, but php is the best web platform ...

anyway, i have read article, and at some points i agree what hes trying to say, but nothing would make me go learn ASP or any other language, i love php
 
php may not be the best language, but php is the best web platform ...
No it is not.

anyway, i have read article, and at some points i agree what hes trying to say, but nothing would make me go learn ASP or any other language, i love php
PHP is still enterprise-viable, so this isn't the worst approach in the world, but do know that there are other options out there aside from ASP.NET and PHP. For example - Python web frameworks, Ruby on Rails, and Node.js.
 
Mind giving some examples of your own experience with PHP when you were thinking that it is bad?
 
Mind giving some examples of your own experience with PHP when you were thinking that it is bad?
Un(?)fortunately I have none as I've never programmed more than a few lines in PHP. If anyone has related stories to tell that could be nice.

To be fair I googled up for some thoughts to speak for the language and there in fact are many good points: among others it's easy to get started with with nearly 0 knowledge about programming, deployment or even computers in general. However every single good point about PHP I read so far had nothing at all to do with the language itself but rather its status as a very widely deployed platform and popular language. I'm not even trying to imply PHP doesn't have its uses, however if we speak of the language design it seems hard to find anything particularly bright about PHP that isn't available in many other languages which don't share the flaws.
 
I didn't read all of it, but he definitely has valid points. PHP isn't the best language around and has it's flaws, but it somehow got a huge community.

I've got to say that I've been working with it for a couple years now and I've developed quite some applications. During that, I never really came across any of the issues he pointed out, mainly because what he thinks is wrong is considered PHP syntax to most of us. For example the fopen part he described, it can be a pain in the ass but hosting providers use it to disallow external URL's from being opened. Things like that have been there ever since the beginning of PHP.

If you do it right, you can build a perfectly fine PHP application. If you're used to other languages, you'll have some trouble finding your way around the way PHP deals with several things. To my opinion, that doesn't necessarily mean that the language itself is bad.
 
I've used PHP for over half a decade. I've coded frameworks and other similar building blocks for web applications in it, to make PHP easier to work with. While coding in PHP, it becomes painfully noticeable to me that the language is sub-par. I wanted to stop using it for a while but it, for the most part, works - so I often shrugged it off.

I've started learning and working with node.js lately and haven't looked back since.

One of the scariest things about PHP... the majority of these issues (especially any API-related issues) brought up in the article are never going to be fixed. I actually took the time to participate in PHP internals discussion for a bit. It was during the time when PHP 5.5 was under development. Some features had already been O.K.'d to be part of PHP 5.5 and others were still being discussed.

I'm not going to harp on the perceived skill level or behaviors of the people discussing these features, but I will say one thing - never did I see improvements to the language being discussed. They were always just new features. Perhaps some of these features could be integrated into the preexisting language... but that hasn't happened. The only way that they otherwise improved the langauge was when they fixed a bug or deprecated something crappy.

PHP is and will be ever-growing, being contributed to by people that perhaps don't understand how poor much of the language is as mentioned in the article. It will become more and more complicated. All we can hope is that they deprecate crap at a decent rate and don't introduce too much crap in each new version of PHP. ...Don't get your hopes up.
 
Back