Live data from Hacker News

PHP is much better than what you think

fabien.potencier.org

91–100 of 346 posts

Re: PHP is much better than what you think

#91
post #32

Earlier quoted context omitted.

"PHP is easy to deploy on. That's it. That's why it's popular. It's braindead easy to go from text editor to web URL, it's braindead easy to unzip someone else's project and run it. It requires virtually zero sysops experience to be able to use. You don't even have to worry about setting those +x bits like you used to in the good old cgi-bin days." And that's exactly why PHP is the better choice for those of us who d…

Spot on - you nailed it. The end user counts here, big time. A lot of the products out there would have precisely zero traction if they required literally hours of piddling around. If you compare it to JVM based commercial offerings, and I'll pick Crucible as an example here, it requires: 1. Find a working JVM that matches it. 2. Piddle around with PATH settings and JAVA_HOMEW. 3. Unzip it. 4. Lots of database config…

The funny thing is that if you do care about nginx and fastcgi you can get blazing fast high-volume/low-overhead php hosting with varnish + nginx + php_fpm.

Re: PHP is much better than what you think

#92
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.

Not really, they look at it the same way - we're building something for them they need to support long(er) term. It's a pretty simple business decision really. A number of clients have been burnt in the past by having to support something a bit esoteric. Often clients actually ask for Drupal (which we downright refuse to do) for that very reason. They want something that's they'll be able to find developers for.

Re: PHP is much better than what you think

#93
If all your friends jumped off a bridge while programming in COBOL, would you follow them?

If Visual Basic was a popular language, did that make it good?

Maybe PHP Addiction is real: http://www.marco.org/2012/06/29/php-addiction. It does seem like its users will go out of their way to defend their choice, as if it really matters what anyone else thinks. Jeff Atwood didn't really rant on PHP so much as link to another rant and lament that there aren't any decent alternatives that are as easy for the rest of the world to deploy. He even called for us to quit whining about PHP's shortcomings and do something about it.

Why is that suggestion so offensive? What's wrong with trying to advance the state of the art of Web development?

Did anyone attacking this "rant" actually read the whole thing first?

Re: PHP is much better than what you think

#94

Earlier quoted context omitted.

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…

So why did you comment in the first place, in what world do you find it expectable to berate something with no working knowledge?

Also I have no trouble developing PHP code that halts on the first sniff of an error. But yes, with no experience of the language it will happily chug along.

Re: PHP is much better than what you think

#95
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…

How many of those jobs are for maintaining old PHP codebases written way back when, though? Basically, what is the ratio of "PHP the sexy web framework" to "PHP the new COBOL"-type of jobs. I can't imagine it's even close to 1.

Most of the jobs I interviewed for back then involved new development. The job I ended up taking turned out to be a ground-up rewrite of a consumer website (which sold for ~€250mm the week after I joined) to bring it from poorly designed PHP4 to better designed PHP5.

Why did they choose to do this in PHP instead of a more respected language? They already had a bunch of PHP developers.

Re: PHP is much better than what you think

#96

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…

I'll play devil's advocate here. Define "proper"? Does meeting a business need, bringing in money, putting food on the table, and paying the rent mean "proper"? If not, why not? PHP has a plethora of flaws, but it's still a serious tool and used to build creations of significant value, that can't be ignored. As far as quality, what platform do you use to guarantee quality? I've heard many stories about terribly broke…

By "proper" I mean building a piece of software which has a clean and maintainable implementation, logical semantics, proper encapsulation, and last but not least, which is solid.

That is, should be able to withstand real world challenges and input-data without crashing, failing, silently failing, creating corrupted data or any combination of those things.

Granted, it's been quite a while since I've done PHP, and it that sense the initial point of the article stand true, but when I need something done in PHP, I always find myself spending more time ensuring basic truths which a proper language should guarantee for me are actually true, than I spend writing code doing something.

I find PHP silently failing all the time making debugging code hard. And it makes it hard to do things proper, because you may have failure-modes which you should have been able to catch, but which PHP "kindly" shields you from.

Hope that clears things up.

Re: PHP is much better than what you think

#97

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?

It would be a lot less of an argument then, and I would be willing to bet that the language would evolve into a far less web-centric area. But in part because of this, if you actually try to do anything outside the web (I have) in PHP, it's not all that pleasant.

Also on the PI tag issue, I would rather keep my PI tags limited to the view or template. it leads to a lot better clarity. and your object classes are no longer technically SGML fragments ;-) This has some nasty side effects if you have a leading space before your opening PI tag and you aren't outputting SGML....

Oh, as a side note, by 'escape from the web' I guess what I really mean is 'escape from SGML-world.' There's a lot of the web that's not SGML-driven and there's a lot of the non-web that is (XML, DocBook SGML, etc).

Bottom line, PHP is a decent tool for working with SGML but it is highly specialized for this. You run into weird things working in SGML mode but not in non-SGML output with things like leading spaces before opening PI tags if you move out of that. Since this is lexically part of the language, I just don't see it changing.

Re: PHP is much better than what you think

#98
post #94

Earlier quoted context omitted.

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…

So why did you comment in the first place, in what world do you find it expectable to berate something with no working knowledge? Also I have no trouble developing PHP code that halts on the first sniff of an error. But yes, with no experience of the language it will happily chug along.

See my clarification. I think I may have been a bit unclear and/or you may have misunderstood my post.

Re: PHP is much better than what you think

#99

Earlier quoted context omitted.

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…

[deleted]

Re: PHP is much better than what you think

#100
post #21

Earlier quoted context omitted.

Facebook.

I keep hearing people mention Facebook as a reason why PHP is a great development language but they compile it down to C++ using their HipHop compiler, and from what I understand they develop Facebook _in spite of_ PHP ( http://www.quora.com/Do-Facebook-engineers-enjoy-programming... )

I got downvoted on another PHP related thread here for bringing that up. Can you truly say they use PHP when they've invested a hell of a lot of money into HipHop to essentially allow devs to write additional PHP code and transform it into C++ binaries? It's a strange way of using it for sure, but it seems to be effective for them.
Post reply on HN