Live data from Hacker News

I Like PHP

beust.com

41–50 of 269 posts

Re: I Like PHP

#41

There's a regular stream of "defending PHP" posts but they all seem to miss the point. No one bashes PHP because it can't do these things, or that it isn't easy. People bash PHP because there are objectively better languages and platforms out there and objectively bad decisions made by those guiding the PHP language. If you want to defend PHP in any meaningful way then you can't just list things that can be done easi…

> If you want to defend PHP in any meaningful way then you can't just list things that can be done easily in almost every semi-modern web ecosystem Did you ever read Python's documentation? Or Ruby's? Or Java's? Show me one popular web programming language which has a full page, up to date, with examples and user comments and version incompatibility info, per function . Of course, it's just one point and I otherwise…

Python's got excellent documentation, both official and third party.

Re: I Like PHP

#42
me too, i like php. it's a decent templating language with some very advanced features. it even supports namespaces!

Re: I Like PHP

#43
post #15

> PHP is exactly like C. Either you like both or you don’t like either, there is no claim you can make about PHP that can’t be made about C as well, and vice versa * C is fast and has tight resource control * C is portable * C has a transitive (==) operator ...

Yeah, clearly this is a troll blog. Congrats to the troll.

Re: I Like PHP

#44

From the comments: "PHP is great for its purpose. Quick scripts that generate web content. It’s even OK for small applications. But just like C, PHP is lousy for the medium to large. Any software project with a duration in months or greater that is entirely in PHP is going to be painful." Like Facebook? Or Wordpress? Or Digg? PHP aint perfect, but it's demonstrably suitable for medium to large projects.

Is developing for Facebook not painful?

Is developing anything of that size, in any language, not painful?

Re: I Like PHP

#45

There's a regular stream of "defending PHP" posts but they all seem to miss the point. No one bashes PHP because it can't do these things, or that it isn't easy. People bash PHP because there are objectively better languages and platforms out there and objectively bad decisions made by those guiding the PHP language. If you want to defend PHP in any meaningful way then you can't just list things that can be done easi…

> If you want to defend PHP in any meaningful way then you can't just list things that can be done easily in almost every semi-modern web ecosystem Did you ever read Python's documentation? Or Ruby's? Or Java's? Show me one popular web programming language which has a full page, up to date, with examples and user comments and version incompatibility info, per function . Of course, it's just one point and I otherwise…

As far as I know, PHP is the only major programming language that considers itself a "web programming language."

Re: I Like PHP

#46
From TFA:

> * I have yet to see this kind of universal support for any other language than PHP. Not even Ruby on Rails, let alone Java, is available on mainstream providers, thereby validating the claim I made five years ago that Ruby on Rails won’t become mainstream (I regularly receive emails about this article asking me this question, and I keep responding “Nope, still not mainstream”).*

If your provider doesn't support Ruby, you need to get yourself a $20/month Linode box. If Linode and a $20/month price point isn't mainstream, I don't know what is.

Re: I Like PHP

#47

There's a regular stream of "defending PHP" posts but they all seem to miss the point. No one bashes PHP because it can't do these things, or that it isn't easy. People bash PHP because there are objectively better languages and platforms out there and objectively bad decisions made by those guiding the PHP language. If you want to defend PHP in any meaningful way then you can't just list things that can be done easi…

> If you want to defend PHP in any meaningful way then you can't just list things that can be done easily in almost every semi-modern web ecosystem Did you ever read Python's documentation? Or Ruby's? Or Java's? Show me one popular web programming language which has a full page, up to date, with examples and user comments and version incompatibility info, per function . Of course, it's just one point and I otherwise…

Um, Python's documentation is separated by release versions - so you can read a doc page that specifically targets the version you are using. That is the right way to do it; with PHP you would have to read the doc page, then also go read any deprecation warnings or caveats for the possible version you are using. What a nightmare to maintain too. Plus, I have yet to come across a Python doc page that doesn't provide usage examples!

I can't speak for Ruby or Java because I haven't even looked at their documentation sites.

User comments? PHP user comments are crap, IMHO - so many people writing so much horrible code in those comments.

I understand where a lot of PHP supporters are coming from because I was once there - I spent four years with the language and thought it was the most beautiful thing that existed. Until Python, Scheme, Erlang, and Haskell invaded my life.

PHP will always be an amateur programming language - which is it's strength, kind of like BASIC, a great stepping stone but nothing more.

Re: I Like PHP

#48
post #9

From the comments: "PHP is great for its purpose. Quick scripts that generate web content. It’s even OK for small applications. But just like C, PHP is lousy for the medium to large. Any software project with a duration in months or greater that is entirely in PHP is going to be painful." Like Facebook? Or Wordpress? Or Digg? PHP aint perfect, but it's demonstrably suitable for medium to large projects.

I think it's probably easier to create unmanageable spaghetti with PHP. It's not that you can't build a large project in PHP, it's that it's easier to foul up. By far the part of PHP that shines for small projects and causes havoc in large is the way includes work. It's possible to be disciplined about this, but it's not common. I remember many times searching in vain for some function or another that was included so…

One of our struggles at Facebook was actually with circular includes that made our php codebase super tasty spaghetti.

File A includes File B includes File C includes File A by about 10000 files.

It was for a very scary trying to change a core library during this time because it was almost impossible to figure out where all it was included and impossible to test all the code that touched it. Additionally, we were basically loading up our entire init stack on every page load and async request because as soon as you loaded up one file all the circular dependencies would load up the entire stack. This had a big performance overhead prior to our switch to HipHop.

To this end we developed a new include system for library files that forces developers to be sane. Every module in the our library files must explicitly include everything that they need and it forbids circular dependencies. If module A requires module B, module B cannot require module A.

Making this change took a long time (in some places we are still untangling the code), but our core code is now infinitely more manageable and most importantly testable.

Re: I Like PHP

#49
> I write PHP code very sporadically

Explains it. PHP is fine if you jump in, write a few lines, and then don't ever have to maintain it yourself. Woe to the guy who does have to maintain it.

Re: I Like PHP

#50

Earlier quoted context omitted.

> If you want to defend PHP in any meaningful way then you can't just list things that can be done easily in almost every semi-modern web ecosystem Did you ever read Python's documentation? Or Ruby's? Or Java's? Show me one popular web programming language which has a full page, up to date, with examples and user comments and version incompatibility info, per function . Of course, it's just one point and I otherwise…

Python's got excellent documentation, both official and third party.

Python itself does, but the third party modules (which do most of the heavy lifting) generally don't. See: Twisted.
Post reply on HN