Live data from Hacker News

PHP is much better than what you think

fabien.potencier.org

61–70 of 346 posts

Re: PHP is much better than what you think

#61
post #37
post #21

Earlier quoted context omitted.

Facebook.

Yes. And now Facebook is spending a ton of resource and man-hours programming around this. They had to write their own compiler! Also, I think they are trying to move away from PHP as quickly as possible without rewriting the entire site. The new projects and tools are not in PHP; moreover, I think most of the new people they hire never have to use PHP at all. Finally, just because they managed to use PHP to run a bi…

The Face Book.

Re: PHP is much better than what you think

#62
post #24

Earlier quoted context omitted.

I guess the worlds most popular websites, and the vast millions of PHP programmers must all not really exist. They can't exist, and can't be making good stuff, because PHP is just doesn't work. Here is a list of template languages people on 'real' platforms use: Python. Airspeed, Castalian, Chameleon, Cheetah, CubicTemp, Django template system, Elements, EmPy, Evoque, HRL Powerful macro preprocessor for HTML, Genshi,…

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?

What kind of an analogy is that? It is not only flawed but does not relate to your argument. I guess the point that illumen was trying to make is that PHP can be used in popular real world applications and is "proven" to scale. Just like Facebook, you can look at Wikipedia, Wordpress, Tumbler or earlier days of Youtube all of which was/is written in PHP!

Be comfortable with the language you prefer and quit whining about the rest!!!

Re: PHP is much better than what you think

#63
IMO, more important than the language itself are the frameworks built on the language. Ruby might be _the best_ language ever, but without Rails it wouldn't have gotten famous. It wouldn't have mattered so much that Python is a beautiful language if Django sucked. If a good framework came out of the PHP community, we could forget that "PHP sucks". A good framework which prevented you from doing stupid things would be really great. Not sure if PHP has anything like that, at this moment.

I use PHP and Python(Django) - work and play.

Re: PHP is much better than what you think

#64
post #37

Earlier quoted context omitted.

Yes. And now Facebook is spending a ton of resource and man-hours programming around this. They had to write their own compiler! Also, I think they are trying to move away from PHP as quickly as possible without rewriting the entire site. The new projects and tools are not in PHP; moreover, I think most of the new people they hire never have to use PHP at all. Finally, just because they managed to use PHP to run a bi…

Do you have inside info on this? I've seen several people from Facebook comment that they are in fact using PHP. The fact that they're compiling to C++ is a consequence of the slowness of the programming language implementations of those languages that are used traditionally for web development. AFAIK Ruby was and still is the slowest of the bunch.

A couple people I know well spent the summer there (I actually visited one at the old headquarters; it was pretty cool). One now works there full time (the other hasn't graduated yet). I also talked to some fulltime engineers who were not using PHP.

Now, it's reasonable that I did not get the full picture, but the people I did talk did not use PHP themselves and claimed that new projects didn't either. Perhaps this varies per team. My impression was that existing code bases using PHP were still under active development (that is, getting new features) but new projects and new developers did not use PHP.

Re: PHP is much better than what you think

#65

"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.

Reducing the cost of your project is a pretty good reason to choose something. Which template language would you choose for those other platforms? One of 200 half-baked templating languages, or something more complete like php?

PHP has better documentation than all of those platforms, so that could be another reason. It has more advanced, popular, and featureful Content Management Systems than all of those platforms.

Re: PHP is much better than what you think

#66
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 still, in essence an SGML preprocessor because even today, all PHP code is contained in SGML PI tags.

This means that your class files, etc. all begin with opening a PI tag....

Now that doesn't mean there aren't some really cool niches for PHP. Using something like PL/PHP and the native XML support in PostgreSQL, you could do some pretty cool stuff. Similarly for lightweight web development there is simply not a better language.

But when you are building a framework where logic may have to be used in non-SGML environments, PHP is a very poor choice. This means when you choose PHP you are limiting yourself to web environments only. Better choices where there is any possibility of escape from the web include Perl, Python, and Ruby.

Re: PHP is much better than what you think

#67
Easiest language to learn for non-technical people? I do not believe that comment was made by someone who has tried to teach a non-technical person on how to program PhP. To get started to write a simple thing like a blog, you need to explain concepts like: classes, inheritance, public/private members, global/local decelerations, and context to name a few. Add that with the X number of ways each thing can be done, and the what ways are "right", and what ways are "wrong", and it becomes a huge information load for the student even before getting started writing something simple.

Re: PHP is much better than what you think

#68

"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…

What do you mean by "more full-featured alternatives". To me the main webdev languages look about the same when it comes to the major features that have a noticeable impact on a project. e.g: few projects are affected by the lack of closures

And all the talk about real this and real that. I don't think projects become more real when they're written in Ruby or Clojure. They're real when they work and are useful to the customers...

Re: PHP is much better than what you think

#69
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 your code with?

Oh. You mean I need to have locale-ware date, time and number-format handling?

Oh. You mean I need to actually validate these input-data and sanitize them for SQL injections and all that before sending off to the database?

Etc etc.

When you need things not just "done", but done proper, how well does PHP stack up then?

It is my opinion (as in opposed to fact) that when you add that one tiny, but oh so important clause, all arguments for PHP being the one language which gets things done falls apart.

Or am I being too simplistic?

Re: PHP is much better than what you think

#70

"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…

Flawed and good are not mutually exclusive. I'm no fan of PHP but I have to give it props. It is a legitimate web platform. No other term is more accurate to describe a tool that is used to drive literally billions of dollars in business and to host content viewed by literally hundreds of millions of users every single day.

PHP is out there. Being put to serious work. If you truly believe that PHP is a terrible and horribly broken tool the most dangerous mistake you could make is imagining that PHP doesn't serve as the backbone of much of the web.

Post reply on HN