Live data from Hacker News

PHP is much better than what you think

fabien.potencier.org

81–90 of 346 posts

Re: PHP is much better than what you think

#81
post #54
post #49

Earlier quoted context omitted.

It's a bit of a Catch22 as well. We switched to using PHP for our agency client work because it was easier to hire developers. Not only that, but clients actually ask for it by name (and we lost a number of jobs because we didn't want to use PHP). The cycle continues.

I don't mean to belittle you or anything like that, but isn't it your job to consult the client on the best tool for the project? If they are adamant on using PHP, when it's clear PHP isn't suited, perhaps that implied an awkward client.

Well, yes, but awkward clients are still clients (read: people who give you money). Some of the consequences of the mentioned effect are that you may be forced to work with awkward clients or employers, or make otherwise awkward decisions.

Re: PHP is much better than what you think

#82
post #49
post #38

Earlier quoted context omitted.

When I first started looking for work here in Dublin, Ireland a few years ago, I saw tens of PHP web stack jobs, 1 RoR job and no Python jobs. While the tides have turned slightly, PHP web stack jobs here still far outnumber Ruby and Python equivalents, especially at the entry level. Some developers like PHP because they can get easily work doing it. Businesses likes PHP because they can more easily hire people. Argu…

It's a bit of a Catch22 as well. We switched to using PHP for our agency client work because it was easier to hire developers. Not only that, but clients actually ask for it by name (and we lost a number of jobs because we didn't want to use PHP). The cycle continues.

There's a good reason for that though.

If you create an app for someone in rails or django or luanode or some such then they are on the hook for maintaining it if you go away or find other work or just don't want to support it. And it's much harder to find devs for those stacks than it is to find PHP devs.

Re: PHP is much better than what you think

#83
post #45

Earlier quoted context omitted.

Saying PHP is good because Facebook use it is kind of like saying phone hacking is good because it was utilised but some of the UK's most popular newspapers... I'd be interested to know if there's any commentary from people high up in Facebook on whether they'd use PHP again if they were starting now?

Look at Quora, Path, and Asana, the three most successful consumer startups started by former Facebookers. None use PHP.

Never heard of them.

Re: PHP is much better than what you think

#84

People who argue for PHP as a language always brings up this one argument: "PHP gets things done". Great. It get things done. Quick and dirty, but it gets things done. That is all fine and dandy, but what when you need things done proper ? How does it stack up then? Oh. You mean you have to consider input-data as actual text, not as some byte-streams which incidentally maps to the same character-set you used to write…

Have you written a production app for PHP in the last 5 years? It handles (out of the box) multibyte encodings, locale-aware number and date formatting, parameterized prepared statements for your SQL, etc as well as most any language.

I'll be intellectually honest and admit that, no, I haven't really touched PHP for anything near a production app in the last 5 years.

But to be absolutely clear: before PHP used to be the only language I wielded for money. I have enough lines of PHP on my back to claim the right to an opinion.

That said, last time I looked into PHP, modus operandi seemed to being focusing on making things easy, not making it easy to do things right.

AFAIK this one quote from "PHP is a fractal of bad design" still holds true and that if you ignore all the other obvious things (wildly inconsistent BCL, etc), it is probably the core reason why I can never bring myself to like anything PHP:

PHP is built to keep chugging along at all costs. When faced with either doing something nonsensical or aborting with an error, it will do something nonsensical. Anything is better than nothing.

AFAIK that's still true, and I find it hard to have confidence in any code written on top of something based on that core tenet.

Edit: Experience clarification

Re: PHP is much better than what you think

#85

People who argue for PHP as a language always brings up this one argument: "PHP gets things done". Great. It get things done. Quick and dirty, but it gets things done. That is all fine and dandy, but what when you need things done proper ? How does it stack up then? Oh. You mean you have to consider input-data as actual text, not as some byte-streams which incidentally maps to the same character-set you used to write…

Have you written a production app for PHP in the last 5 years? It handles (out of the box) multibyte encodings, locale-aware number and date formatting, parameterized prepared statements for your SQL, etc as well as most any language.

[deleted]

Re: PHP is much better than what you think

#86
I think at this stage it would be tempting to give some kind of penalty to PHP good/bad posts. Pretty much everyone who cares one way or the other has taken a position and there is a minimal amount of people actually moving one way or the other.

Anyone who frequents Hacker News is well aware of the options out there for web development. If some people decide that they like PHP for any number of reasons and produce awesome stuff in it great. If some decide they hate PHP and go produce awesome stuff in another language then that is great to.

One thing is for sure we have seen a lot more of "this is all the reasons that PHP is bad" than "PHP killed my startup" posts.

Re: PHP is much better than what you think

#87

"PHP is the best web platform ever", because it (finally) has a decent package manager. And don't mind that far fetched statement, the author will surely delete any rude comments. Congrats, PHP has a package manager. This does nothing to shake my feeling that PHP's most ardent advocates have little hands-on experience with the more full-featured alternatives. You know, like the ones that also have decent package mana…

To put my comments in another light, let me postulate this. If I started a project in python, Go, ruby, C# or even something that ran on the JVM, I could give reasons for why I would choose it for something non-trivial. Outside of "I can hire cheap devs" and "I can run it on el-cheapo hosting", I can't think of a good reason to specifically pick PHP.

Shorten that. "I can hire devs". If you're just a small shop hiring a rails dev, let alone a Go dev, might be effectively impossible. Which is a very big deal for a company that relies on external contractors for a lot of their development, which is a fairly substantial group of small companies.

Re: PHP is much better than what you think

#88

Earlier quoted context omitted.

I'd argue PHP is, for any project of reasonable size, harder to get up and running than say Rails. For any serious development a PHP developer (some experience, did several years of PHP dev) will have to setup a local instance of Apache/ MySQL/ PHP and deal with making sure libraries installed on this dev server match libraries on the production server. When it comes to deployment for both Rails (in this case) and PH…

PHP 5.4 has a local development server, so even that point is moot. But how hard is setting up apache, mysql and PHP? sudo yum install apache php mysql done. And anyway, for a serious project you need a local dev environment that somewhat mirrors live, and then staging (which exactly mirrors live).

Agree it's not that hard, I also don't think it's in any way a bad thing to have to learn how to do it (in fact probably a good thing). Just that learning how to do that is no easier than learning to deploy a rails/ django/ etc app so I'm not sure PHP really 'just works' any more than any other popular language.

Re: PHP is much better than what you think

#89

I am not convinced. My argument is not that PHP sucks or that anything else. It is rather that PHP is lexically tied to corner-case development. In that case PHP is very good at some things but not really all that great for others. PHP started out as being a pre-processor for SGML documents. All PHP code is contained inside SGML program instruction tags. PHP has never changed this, so however it has developed it is s…

I don't follow this argument at all. PHP cannot be used outside the web because each source file starts with <?php ? If I wrote a preprocessor for you so that your files wouldn't start with <?php, what would your argument be?

Re: PHP is much better than what you think

#90
post #38

"PHP is the best web platform ever", because it (finally) has a decent package manager. And don't mind that far fetched statement, the author will surely delete any rude comments. Congrats, PHP has a package manager. This does nothing to shake my feeling that PHP's most ardent advocates have little hands-on experience with the more full-featured alternatives. You know, like the ones that also have decent package mana…

When I first started looking for work here in Dublin, Ireland a few years ago, I saw tens of PHP web stack jobs, 1 RoR job and no Python jobs. While the tides have turned slightly, PHP web stack jobs here still far outnumber Ruby and Python equivalents, especially at the entry level. Some developers like PHP because they can get easily work doing it. Businesses likes PHP because they can more easily hire people. Argu…

Yeah - "shit" being the operative word there. The problem I've found is that there's a kind of anti Python paradox at work with PHP:

Better than 95% of the PHP jobs out there are horrible scut work for companies that don't give a shit about quality or decent development, even though it costs them an arm and a leg maintaining their steaming legacy codebase.

The 5% that you'd actually want to work for need to have a series of huge hurdles to keep out the 95% of PHP mouth breathers^W^Wdevelopers who can't really code.

Post reply on HN