Linked by Kroc Camen on Sat 20th Dec 2008 17:54 UTC
General Development IBM delves into what's new in PHP 5.3: Part-1 shows you the changes to the object-orientated capabilities, and Part-2 shows you the exciting new possibilities with real closures and lambda functions. ["Read more" for Kroc's personal commentary]
E-mail Print r 4   · Read More · 41 Comment(s)
Thread beginning with comment 340906
To read all comments associated with this story, please click here.
Never understood the disdain for PHP
by StephenBeDoper on Sat 20th Dec 2008 21:36 UTC
StephenBeDoper
Member since:
2005-07-06

The writeup makes an interesting observation, pointing out how PHP is often criticized for things that Javascript is lauded for.

I don't really understand why there's so much disdain for PHP. Granted, I wouldn't want to try writing a desktop GUI app with it - but I wouldn't want do that with BASH scripting either.

Reply Score: 2

DrillSgt Member since:
2005-12-02

"I don't really understand why there's so much disdain for PHP. Granted, I wouldn't want to try writing a desktop GUI app with it - but I wouldn't want do that with BASH scripting either."

The disdain, I am guessing, is that too many people try to use it for things it is not designed for. PHP is a server side scripting language for the web. The main purpose when it was designed was to do things you would otherwise need cgi-bin access for, like page counters, etc. It is not for nor intended to be used for writing a desktop GUI application. JavaScript is better suited to that task as it is a client side language, and the code is executed on the local machine instead of on the server. Each has it's own purpose. Too many people try to take one or the other and do everything with it, then bitch about it when it does not work or is too hard to do what they wanted to do. If the right tool was picked in the beginning, this would rarely be an issue.

Reply Parent Score: 5

tyrione Member since:
2005-11-21

"I don't really understand why there's so much disdain for PHP. Granted, I wouldn't want to try writing a desktop GUI app with it - but I wouldn't want do that with BASH scripting either."

The disdain, I am guessing, is that too many people try to use it for things it is not designed for. PHP is a server side scripting language for the web. The main purpose when it was designed was to do things you would otherwise need cgi-bin access for, like page counters, etc. It is not for nor intended to be used for writing a desktop GUI application. JavaScript is better suited to that task as it is a client side language, and the code is executed on the local machine instead of on the server. Each has it's own purpose. Too many people try to take one or the other and do everything with it, then bitch about it when it does not work or is too hard to do what they wanted to do. If the right tool was picked in the beginning, this would rarely be an issue.


And if I'm going to write a Desktop GUI application, I'll write for the platform I'm developing on and use their native Frameworks, none of which are Javascript. Both PHP and Javascript lose their value when they try to play the role of other languages; and completely lose credibility when they proclaim themselves better choices.

Reply Parent Score: 1

StephenBeDoper Member since:
2005-07-06

I had long been curious if there was some argument against PHP that was obvious only to more-experienced coders.

But I had the general impression that you outlined - it does seem that many of the anti-PHP complaints comes from people who are trying to use it in situations where it's not the right tool for the job.

Reply Parent Score: 2

sbergman27 Member since:
2005-07-24

The disdain, I am guessing, is that too many people try to use it for things it is not designed for.
...
It is not for nor intended to be used for writing a desktop GUI application.

Can you point to examples of this? While I realize that the php interpreter can run standalone on a desktop box, I hardly think you can blame PHP's reputation on the vanishingly small number of cases where someone actually tries to use it that way.

PHP has a bad reputation bacause it has traditionally dumped hundreds of identifiers into a single name space, and eschewed objects (among other things). Until, of course, it got superficial bolt-on name spaces and superficial bolt-on object orientation to cover those bullet points. PHP has been the very archetype of the negative things people mean when they derisively refer to "scripting languages".

Personally, I think that PHP has what defenders it does because a lot of people got their programming start with it and really buy into the marketing about it now being object oriented.

PHP has the reputation it has because it was designed, as you say, for web page hit counters, etc. and then people started trying to write large and complex *server-side* applications because it was all they had, or at least they thought it was. And while successive versions have addressed some of the buzz word bullet points, it *still* sucks for writing real applications. For real work, use Django or RoR instead. Or Java, if you're into that and don't care about carpal tunnel syndrome.

Edited 2008-12-21 20:32 UTC

Reply Parent Score: 2