Live data from Hacker News

Ask HN: Why no love for PHP?

news.ycombinator.com

1–10 of 150 posts

Ask HN: Why no love for PHP?

#1
I'm curious as to why I rarely see PHP articles on Hacker News.

Is it because PHP isn't considered a "serious" language, and is mostly the realm of "designers" and "script kiddies"?

Do the developers who visit this site all code in Ruby, Erlang or Objective-C? Are PHP developers a minority in this community?

I play with Ruby & Objective-C on my own time, but at work it's an all PHP shop. We primarily use the Zend Framework, and honestly it's pretty good (good enough for IBM...). With the recently announced build tools, and some of the classes we've developed on top of ZF, I can develop just as quickly in PHP as I can with RoR.

PHP is also fairly popular with successful startups. Larger sites like Digg, Flickr and Facebook are using at least some PHP to scale to fairly massive traffic; even Wufoo (a site which I feel represents what so many of us here are trying to achieve in essence) is written in PHP.

I will agree that PHP is a bit of a mess (backslashes for namespaces?), and that the internet is full of the wrong way to use it; however, there certainly are talented developers writing quality software in PHP. Is there no interest in that here?

Apologies if this is a rehash of a tired topic; I poked around for a few minutes and didn't see anything relevant/recent.

Re: Ask HN: Why no love for PHP?

#2
holds hand up I use PHP. Indeed I use PHP for most of my commercial web stuff (i.e. stuff I make at work & most of my startup ideas).

Mostly I'm a Python fan but for websites PHP is just 100% easier for me because I have a framework I know well (KohanaPHP) and years worth of snippets/experience to use in prototying sites. I bet I can code a simple site faster in PHP than Python.

As to why PHP isnt discussed much on here: well I will hazard a lot of people take the same approach. We love exciting stuff in Python, C and Ruby (well, not ao much ruby for me :P) but PHP is our grab-it-and-run language. If someone knocks on the door and says "make me XYZ website in 2 days" we will probably pull out the PHP.

Nothing exciting and new is really happening with PHP - it is doing what it is supposed to do: help us produce dynamic websites fairly quickly with little fuss. So we can get on with the real job of hacking in Python (or Ruby or C or..... etc.) :D

I could be wrong :)

Re: Ask HN: Why no love for PHP?

#3
PHP has a few downsides, everything from poor naming conventions to security vulnerabilities. People around these parts are always looking for the cleanest solutions to their problems and the latest methods available. PHP's relative age and problems make it neither.

That said, I coded my first startup in PHP. It's dead simple to make a dynamic web page with PHP, but it's also dead simple to create a huge mess. In that sense, PHP reminds me of C. It's pretty simple to write an app in C, but there are 1,000 pitfalls.

Just like with C, there are definitely talented coders out there who can make PHP behave correctly. Sadly, they are a minority. Many of them move on to other languages and frameworks.

I've since moved on to Ruby (on Rails) as well as Python. Both languages offer simplicity and power. Rails, in spite of being the Dane Cook of frameworks, makes it extremely easy to create a web application.

Re: Ask HN: Why no love for PHP?

#4
It reminds me of Perl. Perl literally gave me a headache last time I coded in it. (Incidentally, this is why I'm wary of Ruby as well.) Besides, I am totally satisfied with Python.

Re: Ask HN: Why no love for PHP?

#6
PHP offers little more than convenience. I use it myself because it's so easy to integrate with PHP and MySQL, and it's easy. I think it's a decent platform for a basic web-site, but further than that it doesn't offer anything truly unique or powerful.

Re: Ask HN: Why no love for PHP?

#8

PHP has a few downsides, everything from poor naming conventions to security vulnerabilities. People around these parts are always looking for the cleanest solutions to their problems and the latest methods available. PHP's relative age and problems make it neither. That said, I coded my first startup in PHP. It's dead simple to make a dynamic web page with PHP, but it's also dead simple to create a huge mess. In tha…

Well said. I would recommend Django to people who prefer Python to Ruby.

Re: Ask HN: Why no love for PHP?

#9

PHP has a few downsides, everything from poor naming conventions to security vulnerabilities. People around these parts are always looking for the cleanest solutions to their problems and the latest methods available. PHP's relative age and problems make it neither. That said, I coded my first startup in PHP. It's dead simple to make a dynamic web page with PHP, but it's also dead simple to create a huge mess. In tha…

I agree with more or less with what you said but a downside of PHP is not security vulnerabilities, that's really just a myth. I can't remember the last vulnerability which could be directly attributed to PHP as a language.

Sure, there are plenty of apps containing holes but those are not caused by PHP but by not coding correctly, eg not checking input making SQL injections possible etc.

Which might confirm what you said, it's easy to create a huge mess with PHP.

But then, it's easy to create a huge mess in any other language, too. It's probably even easier with Ruby due to its highly dynamic nature.

Languages are like tools, you have to know how to use it but you can't blame the tool if somebody misuses it.

Edit: Fixed typo.

Re: Ask HN: Why no love for PHP?

#10
I have often thought the same thing as PHP is a fantastic web development language, and it is very well developed. The documentation is very good, and as you mentioned there are useful code examples right in the documentation. The learning curve for PHP is very low, and there is library support for pretty much anything you want to do. Oh, and it is dead simple to deploy.

I think RoR is one large reason why PHP is looked down now. More specifically, there isn't a leading PHP framework that has a proven following or as well executed marketing plan. There are a lot of PHP frameworks, but none that capture the attention of the masses like RoR.

The other argument I hear is that the language is annoying to program in. This just doesn't not compute in my brain as PHP code looks perfectly normal to me. I think that some people just prefer certain syntax, and I have yet to come up with a reason that I understand.

As you have probably guessed I have been a PHP fan for years, but I recently started seriously using Ruby/Rails for some side projects. There are two reasons I am playing with this instead of cakePHP/KohanaPHP/Symfony/Zend

1. There is a lot of literature about Ruby/RoR

2. I found myself resisting Ruby/RoR, and I don't want to be the old guy that won't learn new technology

Post reply on HN