Skip to content

Comment on Moving on from Railsparent

Comments

In defence of PHP:

Firstly, every time I see it getting slammed its nearly ALWAYS PHP in comparison to a framework whether it's rails, django, web2py or whatever. As soon as I see this I can't help but feel the author is just jumping on the "PHP isn't cool bandwagon". PHP isn't a framework, so don't compare it to other frameworks.

Secondly, it is possible to write good code using PHP - and many people do. It powers some of the largest sites in the world and there are more PHP web devs out there than any other working on millions of PHP sites. There are also some excellent frameworks for PHP that are quick to learn, fast and powerful. Codegintier, Yii or Symphony(2) all spring to mind.

Finally, for most web developers who actually need to earn a living writing code to solve problems, PHP is still the most popular choice for good reason. It's easy to earn, easy to deploy, cheap to host and widely used. There are also more PHP jobs (especially in the U.K.) than any other and it isn't changing anytime soon. For the busy developer trying to make a living these type of posts aren't really helpful at best and at worst quite insulting.

I'm not sure you should put "write good code using PHP" in the same paragraph with "some of the largest site in the world". Because they're the exact opposite.

Facebook, Wikipedia, Wordpress, all of them don't have a good PHP codebase. In fact, people despise them.

PS: for the downvoters, why the hate? it's the fact though. I'm not saying you cannot write good code in PHP. What I'm trying to say is that "big sites out there" are not a good example of "writing good PHP code".

A friend of mine recently left Yahoo in no small part because he hated working on their PHP codebase.

I don't know about the other sites you name, but if you had mentioned Yahoo you would definitely have had a point.

"""Facebook, Wikipedia, Wordpress, all of them don't have a good PHP codebase. In fact, people despise them."""

You've seen Facebook's codebase? I doubt it.

And when you show me a blogging platform more successful than Wordpress, then we will talk.

Who exactly despises FB, Wikipedia or Wordpress? Not the users.

And while I can't talk about Wikipedia and FB (haven't seen the source), neither do Wordpress developers (including the tens of thousands of plugin authors) despise Wordpress's codebase.

Also, it's not about how well you like it, it's about what you can do with it, and especially what you users can do with it.

Yeah, Wordpress could have been written in, say, elegant Haskell. And then it would have gotten nowhere, because very few people could have got it working on their webserver or on a shared server platform. And it would have lacked tons of extensions that PHP gives it, from Imagemagick to LDAP to DB2 client libraries --or it would have to use some less battle tested, less popular and less mature Haskell equivalents.

Facebook, Aditya Agarwal, presentation: http://www.infoq.com/presentations/Facebook-Software-Stack

Judge for yourself (you probably have to interpret what he said there since obviously he doesn't say up-front "it sucks" but the words he chose describe the situation).

Maybe despise is a strong word.

But what's your point? successful project so they must have good codebase or something?

My original post was that "those projects don't necessarily have a good code base" (thus you may want to choose other examples to show a better written PHP code base).

You're off by miles.

"""But what's your point? successful project so they must have good codebase or something?"""

I never implied that "because they are successful, they must have a good codebase". I actually made a different point, essentially asking in return:

What's a "good code base"?

Wordpress's, for example, is good at what it does, not in some idealistic theoretical way. Not only it resulted in a successful product (actually two: wordpress + wordpress.com), but it also has been proven stable (heard often of WP crashing mysteriously for any other reason that too much load and no caching which is totally reasonable?) and flexible to build upon (wordpress constantly adds features to its core and tons of developers add third-party add-ons).

I'd argue that "good" code base = flexible, extensible, successful, liked by IT'S developers. WP has had all of those. So, for THEIR PURPOSES and to THEIR DEVS, it is a good codebase.

On the other hand you implied that FB, WP, Wiki's code is bad. I tried to show that WP's at least is far from bad by MANY metrics. What are your metrics? Besides, say, proof by rigorous handwaving?

As for the FB presentation, he never says despise or sucks, as you mention. It's a classic presentation of some trade-offs. You'd have a selection of those even if you coded in Haskell or whatever.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.