Live data from Hacker News

Ask HN: Why does PHP "suck"?

news.ycombinator.com

11–13 of 13 posts

Re: Ask HN: Why does PHP "suck"?

#11
post #9
post #6

I know HN ist not place to prais php... PHP ist easy to learn and it easy to code in php, but if your a professional software developer you can also write professional software for php. You can develop faster, because of large amount of built-in functions and classes. The "shared nothing" philosophy makes it almost unbeatable in terms of performance. Thats why a majority of large sites like Facebook, Wikipedia, Yahoo…

Please explain how you consider it 'less structured'. I admittedly don't work with much PHP any more, but it has namespaces, classes and objects. I can write linear Python just as ugly as anything a PHP developer could come up with (probably). And I could write MUCH more destructive C code than anybody in PHP could (probably). If you mean it's less structured because of Rails or Django, I'd submit that PHP has CodeIg…

I think part of this is the fact that there are a myriad of functions that are just "baked in" to the language, making it a little chaotic. Sometimes it seems like some PHP contributer needed some function and just decided to add it to the language. (Examples: rsort, sort, http_build_query, rawurldecode, urldecode, etc.)

There should be Util or Helper libraries that do that, and in a much more organized way. On the flip side, these commonly used functions are written in C, so they're most likely faster than if you were to write your own in php or load a library.

Either way, I love PHP and use Symfony for all of my projects. PHP/Symfony is pretty much like rails but without the cracked out ruby syntax.

Re: Ask HN: Why does PHP "suck"?

#12

Yes...it sucks so much, that Facebook used it to scale a network worth $50 billion dollars today. From a coding perspective, it is a very "loose" language (not that kind of loose). This has advantages and disadvantages, depending on what you are doing. It is very easy to learn, and therefore there is a large degree of stratification with PHP devs. Professional coders turn their nose up at PHP, because it is kind of l…

It's funny but people always reference Facebook whenever PHP is called to discussion. Former CTO and now cofounder of Quora, Adam D'Angelo, has said so himself the main reason for Facebook staying on PHP was mostly for legacy reasons. There was simply no good reason to continue using PHP but it had already become a core part of Facebook so they optimize as best as they can. In building Quora, he decided in hindsight to use Python and had Facebook not been so entrench in it, they probably would have switched. That isn't to say Facebook doesn't already use other languages as part of their infrastructure. And it was in part why hiphop was developed.

That said, I have nothing personal against PHP and have been a PHP developer for years. It does get the job done and is forgiving as you have said but make no mistake, there are better alternatives. There are things that, for example, Python and Ruby is able to do that PHP can't since PHP is purely a web base language and Python and Ruby are not. At the end of the day, it's really what the developer is most comfortable with.

Re: Ask HN: Why does PHP "suck"?

#13
post #12

Yes...it sucks so much, that Facebook used it to scale a network worth $50 billion dollars today. From a coding perspective, it is a very "loose" language (not that kind of loose). This has advantages and disadvantages, depending on what you are doing. It is very easy to learn, and therefore there is a large degree of stratification with PHP devs. Professional coders turn their nose up at PHP, because it is kind of l…

It's funny but people always reference Facebook whenever PHP is called to discussion. Former CTO and now cofounder of Quora, Adam D'Angelo, has said so himself the main reason for Facebook staying on PHP was mostly for legacy reasons. There was simply no good reason to continue using PHP but it had already become a core part of Facebook so they optimize as best as they can. In building Quora, he decided in hindsight…

"At the end of the day, it's really what the developer is most comfortable with."

Totally agree. I would maybe extend to say its what the team of developers is most comfortable collaborating around (assuming you are more than 1 person).

Basically, it should be about building a good product. The end user generally couldn't care less what programming language your project was built in. If you can deliver the best experience in the fastest amount of time with programming language X, then that's the one you should use.

Post reply on HN