Hacker News new | ask | show | jobs
by kentnl 5776 days ago
I know its trolling to say "Eww, PHP", but every time these days I see yet another project that runs on it, a little part of me dies inside. :(
4 comments

It wouldn't be trolling if you actually explained why you thought PHP was not appropriate for this project. The developers already covered the reasons why they are using it in the FAQ - http://www.gnu.org/software/social/faq.html :

Why are you using PHP? Ruby/Python/Perl/A GUI in Visual Basic would be better!

Better for who? Look at the success of phpBB and Wordpress -- PHP is pretty much everywhere, and while maybe your favourite language is more elegant, PHP is largely ubiquitous.

Mostly negative personal experiences.

But that aside, saying "its everywhere" is in my opinion the /poorest/ argument in favor of anything technical.

MySQL has their slogan as being the "Most popular Open Source database", which, by comparison to PostgreSQL's slogan "The most advanced Open Source database", awful.

If you're popular AND good, thats fine, but being popular alone is a poor metric.

I'm not making the argument from a technical perspective, but from a cultural one. Culturally, this stuff works best if there are bazillions of instances out there, not thirty.

PHP offers that, and I don't think I can name anything else that I can say that about.

IMO if this thing is worth anything the value is in the protocols, not the code. I hope you're envisaging other implementations.

On vaguely which subject, is there some documentation of the protocols anywhere? I had a quick look on the site and couldn't see anything like that.

That depends. Are you running it on a shared host? PHP is one of the few you can guarantee to be there. That makes it cheap to run a small instance.
_Look at the success of phpBB and Wordpress_

Look at the number of horrific security holes in phpBB and Wordpress. Every other release or so fixes some new flaw.

PHP doesn't do enough to encourage building maintainable software. The vast majority of code I've seen "in the wild" grows from a thin, simple layer of logic & SQL queries into an insatiable maintenance monster.

Note: I'm holding back a lot of language nerd rage, so I'm keeping this post very short.

So use a framework. Php's problem is that it doesn't come with an structure. The plus is that you can use any framework that works for you. I use http://www.yiiframework.com and it has shaved 70% off my dev time.
PHP doesn't make it any more difficult to write maintainable software it just makes it easier to not write it.
Take a look at the code, it's well structured.
> PHP is largely ubiquitous.

Easy to deploy, but hard to find skilled hackers who will voluntarily work in it.

Maybe some people will stick their noses up at working on PHP. I'm not super excited by those people, and I think its a shame when talented developers get embittered into language wars, but I can certainly understand why they happen.

I tell everyone working on GNU social that we're going it for the betterment of the world, not their own personal situation. That means running it everywhere.

What about facebook?
Facebook has too much legacy code to switch from PHP to anything sane, but I don't doubt many of them would like to. The Quora guys promptly adopted Python after leaving.
it's probably going to be hard to get facebook developers to work on gnu social though :)
They get props for compiling the bloody thing to C++.
I was the main pusher for PHP in the early stages of GNU social development -- out of interest, what would you use instead, given our goal of having this installed on as many web servers as possible and as cheaply and easily as possible?
The "its easy to get it on a webhost" is one I'll give you, its not really even arguable. Sadly this is one of those annoying chicken-egg issues I try rally against.

Lots of webhosts are really sub-par, and tend to rip off their clients, and much of these same webhosts refuse to give root access, which is a pre-requisite for most of the non-PHP languages.

Sure, PHP will work on these platforms just fine, but as usual, the more people who produce PHP products, the more people out there who'll start dirty nasty webhosts trying to capitalize on that fact, perpetuating the bad hosting situation.

As for personal preferences from a technical standpoint, I'd have hoped somebody like GNU would have had the intuition to develop something well developed like a long-lived FCGI servlet application, which seems to be easy to do in every language except PHP.

PHP seems optimized for the developer use-case where "Something that runs perpetually and handles each request through the system chain" is "Too hard, and Too confusing", and instead they tailor to the 'Every request reloads everything from scratch' style of programming, which is in my personal opinion a design flaw.

Context: I was a PHP programmer for a while. These days I tend to become progressively more and more ashamed of that fact ( except in the obvious case here where I use it to bash it =) ). As a result, I don't frankly care what you use, I like Perl myself these days, but go ahead, use Python or Ruby, both increasingly more common. Heck, use C++ or Java for all I care, there are many decent systems, libraries and web frameworks in those languages ( that is, compared to the pathetic PEAR/PECL + Several dozen frameworks which each and every one of reinvent every wheel twice ), just use one, as long as its NOT PHP.

This is why we'll be recommending a bunch of hosts who are good.
I bet this project wont harm you inside: http://github.com/huberry/phuby
Yes it is trolling, so please stop it. If this thread gets started on each and every post that is somehow related to PHP it doesn't add to the discussion.

Go write the same thing in Ruby or Erlang or whatever if you can't stand the idea of software being written in PHP, or shut up.