Live data from Hacker News

PHP is much better than what you think

fabien.potencier.org

171–180 of 346 posts

Re: PHP is much better than what you think

#171
post #136

OK, I hate PHP. It's ugly, and I don't want to code anything with it. Good developers mostly aren't available to small shops like mine; I don't have anything to get them in. I must do with young, cheap developers anyway. Young cheap developers knows only one language, to be chosen among PHP or Java (that's just the way it is). So I'm getting a whole lot of interns coming in for two months at a time, and they mostly k…

Using intern developers to write PHP.

I really hope you're using a framework, because that above sentence is a recipe for disaster.

Re: PHP is much better than what you think

#172

To be honest I don't like PHP for exactly the reasons I don't like javascript. It's easy to write in a way which is stupid. You can write good php and you can write cool stuff with it. It is easy to non-technical folk to pickup and write a little bit of. It's also amazingly easy to: 1) Write code which is broken and stupid (woops, left error_reporting(E_ALL) on! silly me. dumped all the passwords out into the website…

1) Use a framework like Symfony2.

2) Yes, I agree, PHP encourages you to write esoteric code. Oh wait, what the fuck am I smoking? Better yet, what are you smoking? You can do this in every language I know.

3) Use unit and functional testing. You do use automated testing, don't you?

Re: PHP is much better than what you think

#173

Earlier quoted context omitted.

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

Talking about the PHP of 2006 and then blasting the PHP of 2012 is like talking about George W Bush and then blasting President Obama. They're almost completely different language, and while PHP 5.3 certainly has warts it's vastly better than PHP 5.0.

To me, every PHP version being vastly better than the previous version says something: the current version is shit too, it's just going to take another few versions until you admit it :P

Compared to something like python, where version 3 has basically one major improvement over version 2 (ie, a unicode core); everything else was done pretty much right the first time, and massive changes aren't needed.

Heck, you can still use 2.5 (the python of 2006) quite happily today, and you'll be missing out on a few nice features that would make your life easier, but there's nothing wrong with it like there is with previous version of PHP.

Re: PHP is much better than what you think

#176
post #32
post #13

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. For those of us who aren't afraid of a little ops work, there are far b…

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

How many webapps are installed by non-technical users? I guess for scripts (Wordpress, phpbb, etc.), PHP is the best option for this reason, as they have thousands of installations, but most webapps only have a few.

Re: PHP is much better than what you think

#177
What would happen if you could put a tag with python code right in a page just like you do with the tag? Is this even theoretically possible?

I feel like the biggest advantage PHP and classic ASP have is that there is a low barrier to get the most basic dynamic content working. If you're not a programmer, you don't need to understand a framework or a design pattern to get things going.

Re: PHP is much better than what you think

#178

Earlier quoted context omitted.

Talking about the PHP of 2006 and then blasting the PHP of 2012 is like talking about George W Bush and then blasting President Obama. They're almost completely different language, and while PHP 5.3 certainly has warts it's vastly better than PHP 5.0.

To me, every PHP version being vastly better than the previous version says something: the current version is shit too, it's just going to take another few versions until you admit it :P Compared to something like python, where version 3 has basically one major improvement over version 2 (ie, a unicode core); everything else was done pretty much right the first time, and massive changes aren't needed. Heck, you can s…

If I plot two lines on a graph for you:

y1 = 0.02x + 1

y2 = 0.10x + 0.5

Regardless of the fact that y2 started at 0.5, fully half of what y1 started at, at some point y2 overtakes y1. It's impotent to whine endlessly that a language used to be bad.

So PHP 5 years ago was terrible. PHP today is 'nearly as good' as Python (I'd argue it's better). In 5 years PHP is going to blow Python out of the water.

These languages that are 'better than PHP' have no appreciable market share, and it's not a vast conspiracy and it's not because PHP caters to the lowest common denominator. It's because they suck, fundamentally, at getting things done. WordPress doesn't exist in Python. Symfony doesn't exist in Python. Doctrine does, but PHP has more database drivers than Python so Doctrine is better.

You can be terse, elegant, and beautiful in Python. That's great, but no one I know has ever cared about what the code they're paying for looks like. They care about stability, agility, and testability - things you've been able to get in PHP since 2005.

Re: PHP is much better than what you think

#180

Earlier quoted context omitted.

A great part of Fabien's work is that he pushes people onto the latest releases. Symfony2 cannot be used without PHP5.3 which is great of keeping people's servers more up-to-date. Frameworks such as CodeIgniter were guilty of keeping compatibility with PHP4 for far too long. The world of PHP is a nicer place if you are on the latest version and are aware of the latest features such as namespaces etc.

It's a double-edged sword however. Users stuck on PHP 5.2 will miss out on potential security fixes to Symfony 2. This can potential compound an already bad situation. I'm not saying Fabien didn't have good reasons, more playing Devil's Advocate.

If only cheap shared hosting was consistently up to date :<
Post reply on HN