Veekun
me.veekun.com · Personal blog · on HN since 2011
Eevee (Alex Munroe) writes about programming, language design, and software practice, including a well-known critique of PHP.
What HN saysHN commenters repeatedly cite 'PHP: A fractal of bad design' as the definitive case against PHP, often as an answer to defenses of the language.
76HN people shared it
58linked it in comments
21stories submitted
1.9Kstory points
13 years agolast shared
2011people per year2026
Most-shared posts
- 1PHP: A fractal of bad design54 people · 766 points · first shared 2012 · 495 comments on HN
- 2The Controller Pattern Is Awful, Or, Stop Writing Stupid Classes6 people · 13 points · first shared 2013 · 5 comments on HN
- 3Fuck passwords2 people · 660 points · first shared 2011 · 240 comments on HN
- 4Quick doesn't have to mean dirty2 people · 37 points · first shared 2012 · 19 comments on HN
- 5A new use for StackOverflow2 people · 27 points · first shared 2013 · 1 comments on HN
- 6CVs and File Extensions2 people · 4 points · first shared 2013 · discussion on HN
- 7Mozilla and Free Speech2 people · 2 points · first shared 2014 · 1 comments on HN
- 8Pattern matching, principles, and knee-jerk reactions2 people · 2 points · first shared 2012 · discussion on HN
- 9I only know PHP. How do I write a Web application in Python?1 people · 230 points · first shared 2012 · 186 comments on HN
- 10Python FAQ: Equality1 people · 91 points · first shared 2012 · 10 comments on HN
- 11Python FAQ: Descriptors1 people · 41 points · first shared 2012 · 2 comments on HN
- 12Tmux is sweet as heck1 people · 20 points · first shared 2012 · 1 comments on HN
- 13A little bit Rusty1 people · 4 points · first shared 2013 · discussion on HN
- 14A Brief Overview of Copyright1 people · 1 points · first shared 2014 · discussion on HN
- 15Atom.xml1 people · first shared 2013
What HN people wrote when they linked it
moreentropy · 2014-01-26
There are a lot of reasons already discussed, this one is especially famous: http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-design/
PHP is not a exceptionally bad platform from a technical perspective, it usually gets the job done, is reliable, easy to operate and performant.
But i guess the real reason why so many developers - including me - hate PHP is that plain PHP is pretty boring. It doesn't have opinions on anything and no exciting concepts or language features. Now you can use great frameworks that implement great ideas in PHP, but because PHP has been around for a long time, much of the code out there and still in production is spaghetti code that is no fun to work with and the only option to change that is often a complete rewrite.
spellboots · 2013-12-24
Obligatory http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-design/
I spent many years doing PHP. I am very glad that those years are behind me. Even if you allow for it being easy to setup - which is debatable - setup only happens once and is not very hard in any language. If you find it hard to install a programming language by following instructions, you are an amateur pretty much by definition.
sneak · 2013-10-29
You didn't miss your cue, and delivered your lines perfectly. We're done for the day, we're not bringing in Eevee[1] and Dziuba[2] to shoot the "every language has warts hahaha what are you, a noob?" scene until tomorrow.
You did great, thanks again. Don't call us, we'll call you.
[1] http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-design/
[2] http://pages.citebite.com/b2x0j8q1megb
jpatokal · 2013-06-25
Yes, there are a few problems with PHP, and the following rather famous blog post outlines them quite nicely.
http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-design/
laumars · 2013-06-25
I loved PHP at first too, but the more I started to do serious work in it, the more I grew to hate it. There's so many better languages out there these days, but PHP seems to live off the hype it gained when it was basically a choice between CGI/Perl, Classic ASP and PHP.
PHP ended up annoying me so much that I switched back to Perl (using mod_perl for performance critical stuff). However my latest project is being written in Golang (I know it's all just personal preference, but everything that I hated about PHP, Go seems to get right)
I know many HN members will already be familiar with the following blog post, but it highlights up many of my frustrations: http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-design/
egeozcan · 2013-03-10
Actually there are better alternatives which can replace Comic Sans entirely but to the newbie wannabe designer who wants to get something out, if you argue this, you get a response as if you've recommended ruby to a php developer (Ok, maybe not that strong). The activism against them look quite similar: http://www.sitepoint.com/friends-dont-let-friends-use-comic-sans/ vs http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-design/ </stereotyping>
the_gipsy · 2013-02-26
It is build around a model of process input, spit output, exit; which is not what you want for long living processes. There are many articles about it's flaws, my favourite is this one: http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-design/
mosselman · 2012-11-06
I meant PHP.
I don't want to spark some sort of war on what language beats up your language. So I wont. Besides I don't think something 'being everywhere' makes it good. By that standard lots of things in this world are good.
PHP is exactly what you say it is with regards to being similar to a workhorse. It is a tool for programmers who like to work very hard to achieve something that a harvester could do a lot quicker and more efficiently.
Alex Munroe explains what I meant better than anyone I have seen. It is a great read. Also if you like PHP.
http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-design/
He does not bash PHP, he explains why he thinks it is the wrong tool for the job. Interestingly, he also uses the tool analogy. We are all so predictable :).
jacobwg · 2012-09-06
I agree with many of the other comments here (I prefer ruby myself, but agree that the architecture is what determines scalability).
On the PHP bit, I've done a fair amount of PHP work, but am trying to avoid it for the following reasons: http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-design/
brlewis · 2012-06-29
Follow the "deeply flawed" link in the article to see lots of bullet points of precise criticisms. The target of the link is http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-design/
eropple · 2014-04-08
Once you've decided that the "tolerance" of letting one person fuck with less privileged people is virtuous, I literally can't say anything that will parse for you. I'll leave you with a link to the best description of this bullshit affair and one quote from it, and then I am done.
> Did you catch the problem here? I’ll spell it out for you: he doesn’t give a shit about tolerance, or opposing discrimination. He only cares insofar as people tolerate him. He wants to be left alone to fuck with other people.
> And he is wielding it as a weapon to shut everyone up.
It applies to those preaching tolerance for Eich as well as Gerv, about whom Eevee is writing. A "tolerance" that amounts to "sure, he's actively tried to hurt you, but let that slide" is not particularly meaningful. (Whereas the tolerance of "gay people can get married, and if I don't want to get gay married I don't have to" is meaningful because it is not infringing upon anyone--but you'll notice that the word "tolerance" is rarely used by people who support such basic dignities. Strangely enough, it's so frequently the watchword of the oppressor, not the oppressed.)
http://me.veekun.com/blog/2014/04/05/mozilla-and-free-speech/
toupeira · 2013-08-24
Reminds me of this glorious quote from http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-design/:
"I can’t even say what’s wrong with PHP, because— okay. Imagine you have uh, a toolbox. A set of tools. Looks okay, standard stuff in there.
You pull out a screwdriver, and you see it’s one of those weird tri-headed things. Okay, well, that’s not very useful to you, but you guess it comes in handy sometimes.
You pull out the hammer, but to your dismay, it has the claw part on both sides. Still serviceable though, I mean, you can hit nails with the middle of the head holding it sideways.
You pull out the pliers, but they don’t have those serrated surfaces; it’s flat and smooth. That’s less useful, but it still turns bolts well enough, so whatever.
And on you go. Everything in the box is kind of weird and quirky, but maybe not enough to make it completely worthless. And there’s no clear problem with the set as a whole; it still has all the tools.
Now imagine you meet millions of carpenters using this toolbox who tell you “well hey what’s the problem with these tools? They’re all I’ve ever used and they work fine!” And the carpenters show you the houses they’ve built, where every room is a pentagon and the roof is upside-down. And you knock on the front door and it just collapses inwards and they all yell at you for breaking their door.
That’s what’s wrong with PHP."
adambard · 2013-05-15
I cannot possibly hope to express the reasons I dislike PHP better than this comprehensive article: http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-design/
An excerpt:
> I can’t even say what’s wrong with PHP, because— okay. Imagine you have uh, a toolbox. A set of tools. Looks okay, standard stuff in there.
> You pull out a screwdriver, and you see it’s one of those weird tri-headed things. Okay, well, that’s not very useful to you, but you guess it comes in handy sometimes.
> You pull out the hammer, but to your dismay, it has the claw part on both sides. Still serviceable though, I mean, you can hit nails with the middle of the head holding it sideways.
> You pull out the pliers, but they don’t have those serrated surfaces; it’s flat and smooth. That’s less useful, but it still turns bolts well enough, so whatever.
> And on you go. Everything in the box is kind of weird and quirky, but maybe not enough to make it completely worthless. And there’s no clear problem with the set as a whole; it still has all the tools.
> Now imagine you meet millions of carpenters using this toolbox who tell you “well hey what’s the problem with these tools? They’re all I’ve ever used and they work fine!” And the carpenters show you the houses they’ve built, where every room is a pentagon and the roof is upside-down. And you knock on the front door and it just collapses inwards and they all yell at you for breaking their door.
> That’s what’s wrong with PHP.
nbouscal · 2013-05-11
There are two very different types of arguments typically made as to why to learn the more esoteric languages (Haskell, Lisp, Forth, others).
The first is the more common: learning these languages exposes you to other ways of programming, which in turn makes you a better programmer no matter what language you're programming in. This is unquestionably true. Mainstream languages are constantly learning new things from these languages, which means you will be able to apply the techniques you learn from them to your code no matter what language you write in. I have the misfortune[1] of writing a lot of PHP at my day job, but it turns out even PHP has support for filter and map over arrays. If I hadn't learned functional programming, I would never have even looked for them.
The other argument, which is made less often, is that you can actually write great software in these languages. This argument is made less often because we can obviously look at the market and the TIOBE index and see that Haskell is way down at #30 with 0.323% of the market share. However, there are really great programs made in Haskell (xmonad, for one). There are also tons of great programs made in Lisps, especially Clojure of late. So, this second argument is not entirely a dead end either.
Revisiting something I mentioned in the first argument for a moment though, I would actually make a third argument that I rarely see. As I said, other languages are constantly learning new things from these languages.…
Skoofoo · 2013-04-08
Instead of focusing on making a PHP framework that's like Rails, you should focus on "how can I boost developers' productivity in a unique way?" This is how libraries and frameworks become popular. If you try to model your software after existing software, it'll only ever be second-best, at best.
Rails became popular despite few people knowing Ruby because it took full advantage of the language's expressiveness and ergonomics and had innovative abstractions.
Today we're slowly shifting towards things like Meteor, which combine back-end and front-end development and make it super simple to write dynamic single page web-apps.
The primary issue with your framework is that the PHP ecosystem is already saturated with traditional MVC frameworks. Most experienced web developers who care about their craft have been shunning PHP for a while now [1], and those who do use PHP will probably stick with a more stable, documented and in-demand framework like CakePHP.
The pragmatic thing to do would be to contribute to your favorite framework instead of making a new one, unless you can start something that boosts productivity in a unique way. Contributing doesn't have the same glamour as leading your own thing, but remember that this is open source -- we're all on the same side.
[1] http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-design/
l0gicpath · 2012-10-07
Php is a scripting language specifically designed for web development. Hence, not fit to be in a head to head comparison with a general purpose programming language.
Thus the comparison is held at that level (web), comparing php with a web framework. If that wouldn't make any sense, then it does make sense to compare php with C++ or Java (which it doesn't).
After all, you can write a website in C++.
Putting that aside, your viewpoint is hilarious as well. I find it amusing how you call the issue you linked at, a core rails bug when your knowledge of rails doesn't qualify for such a statement.
It wasn't a bug. If you are a rails developer, have indeed read the issue and replies or at least read the title well enough, you would have concluded that it was a bad coding practice.
The security measure to prevent such mass attribute assignment "was" present for developer's to utilize.
It's a single line of code, but some lazy asses wanted that auto-generated/forced/opt-out instead of opt-in.
It's a good practice, an advised practice, a recommended practice to write that single line of code. The fact that a mass majority of rails developers didn't write it, or ignored this warning doesn't mean it's a "core rails bug".
No, the ruby/rails community is not as large as Php.
Yes, the php community has an awkward tendency to write "below" the par software while charging for it.
Any experienced php developer will confirm this sad fact and will probably blame the language for…
exabrial · 2014-05-01
http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-design
Ah crap... I will not troll anymore on HN. ::slap::
I will not troll anymore on HN. ::slap::
I will not troll anymore on HN. ::slap::
I will not troll anymore on HN. ::slap::
orblivion · 2014-03-20
You're making a mistake. The question is not whether to start a company with PHP vs language X. The company is long started. The question is not whether or not to poof into existence a port from all of FB to language X. That's not possible. The question is, given that PHP is the current language, with all its faults, will it it cost more (including all definitions of cost) to make the switch? How long will it take? Does it get the job done? How bad is the damage?
The question more pertinent to your argument is, did they make a mistake years ago choosing PHP? That's when the could have conceivably gone with language X.
BTW the types of stuff you're listing are documented here. So thorough it's amusing to read: http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-design/
ColdHawaiian · 2014-03-03
I'm assuming that you're referring to "PHP: a fractal of bad design"[1]?
[1]: http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-design/
neduma · 2014-01-26
Don't forget the epic php bashing post - http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-design/
lawl · 2014-01-26
I could write something here. But someone has already written a pretty comprehensive post on what's wrong with PHP. So I'm going to refer you to that.
PHP a fractal of bad design: http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-design/
josteink · 2014-01-09
"haphazardly accumulated features" is not an explanation, it's a subjective point of view.
If you really need it, here's a very good write-up which should cover that in an impressively detailed manner:
http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-design/
chrisweekly · 2014-01-09
For me, this is the definitive take-down of PHP:
http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-design/
Even if a handful of those issues have been addressed in the intervening 15 months, the depth and breadth of fundamental problems remains. /$.02
usamec · 2013-12-24
High quality PHP does not exists, since PHP is ultra low quality language:
http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-design/
mseepgood · 2013-12-19
PHP has a ton of oddities:
http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-design/
straws · 2013-11-24
I think we're mostly in agreement, @dj-wonk. Objects are about bundling that state and behavior, nothing more. How they're created or instantiated is secondary.
It's unnecessary to create classes for functionality when it's unnecessary to create objects for functionality. Here's an eloquent article on that subject:
http://me.veekun.com/blog/2013/03/03/the-controller-pattern-is-awful-a…
dschiptsov · 2013-11-12
If PHP is a fractal of bad design, then MongoDB is PHP of database world.)
As for MySQL, Mongo marketing guys have learned the lessons from MySQL very well - there are nothing but "satisfied users", "good documentation" and "quickness and easiness" (any thinking, leave alone understanding aren't required) on their site and paid content - well-done "product", designed to trigger an ignorant consumer snap-judgement, the same way MySQL did at its time. They use the same sales strategy.
http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-design/
meowface · 2013-11-10
This lists some of the reasons: http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-design/
josephlord · 2013-10-10
I voted dislike to PHP despite not having used it. I read an article listing a fairly significant number of fairly fundamentally broken thing and gotchas many of which fail silently and keep running corrupting data and I decided that I didn't want to go near it.
I don't want to use it and even go to the extent of avoiding open source software that does. It isn't about cool points but purely about whether I want to use the language.
I like types and type checking and halting with exceptions on errors. Do I think that makes me cool; no, but it does make me dislike PHP and use Postgres rather than MySQL (even before my Oracle aversion became relevant).
Edit: This was the article: http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-design/