Xaprb

Stay curious!

Reason #283 why PHP is less productive than Perl

with 16 comments

PHP has no built-in debugger.

This is HUGE. The ability to say perl -d .... and have a fully featured, gdb-like debugger at your command, with absolutely nothing to download or install, is HUGE.

Debugging PHP is an epic pain in the best of circumstances, and it’s all but impossible on a system you don’t control and can’t waste a bunch of time on even if you had permission to install things.

If I’m wrong, please correct me!

Further Reading:

Written by Xaprb

November 6th, 2008 at 9:23 am

Posted in Coding,Perl,PHP

Tagged with

16 Responses to 'Reason #283 why PHP is less productive than Perl'

Subscribe to comments with RSS

  1. PHP has much more clear syntax in my opinion, so you just don’t need a debugger if you use PHP ;)

    Vladimir

    6 Nov 08 at 12:07 pm

  2. I agree that an integrated debugger would be nice for PHP, however so far I’ve never needed one. Perl, yes I have needed one :)

    themattreid

    6 Nov 08 at 2:31 pm

  3. PHP developers usually debug their code by setting the error_reporting = E_ALL or by using a lot of echo/print/var_dump functions ;-)

    I do agree that PHP should include the XDebug extension by default, which can be installed by issuing the command (ok, and a few php.ini tweaks :-) )

    shell# pecl install xdebug

    After which you can now debug PHP code even on an IDE, and you can do code coverage analysis too!

    hth.

    Ariz Jacinto

    6 Nov 08 at 2:54 pm

  4. Real programmers use ASP.NET.

    Not toy languages from the 80s.

    Josh

    6 Nov 08 at 5:55 pm

  5. @Vladimir
    It’s the programmer who uses syntax not a language. One can write ugly code in any language.

    @Ariz Jacinto
    Unless you do not control a system, or it is a production system, where such an extension is a no go.

    smyru

    6 Nov 08 at 7:19 pm

  6. “It’s the programmer who uses syntax not a language” — that is very well said.

    A quick note on where I’m coming from: I’m expert in both PHP and Perl, and have been for a long time, so my criticism of PHP is founded on a lot of experience. I am not just an outsider criticizing the language.

    Xaprb

    6 Nov 08 at 7:24 pm

  7. actually,we can use xdebug or zend debugger to debug php. eclipse+php plugin is a perfect IDE

    zzzgc

    6 Nov 08 at 10:30 pm

  8. zzzgc, BUILT IN. So when I go to a client’s site and something is having a problem and I’m logged in via SSH through 5 gateway boxes to get around firewalls and there isn’t root permission or even ACCESS to the outside world, and all I have is a single shell prompt and not a hope of even something like downloading some outside code or whatever. BUILT IN as part of the PHP binary. From the Unix command prompt. No IDE, no nothing.

    This is incredibly useful and it does not exist and as a result, countless thousands of hours are spent.

    Xaprb

    6 Nov 08 at 10:57 pm

  9. This maybe a very newbie question but since your are on the topic let me ask. How do you remote debug Perl cgi applications? I am new to Perl cgi coming from Java server side technologies.

    Abhi

    6 Nov 08 at 11:41 pm

  10. @Josh — how utterly naive you must be.

    fenway

    7 Nov 08 at 12:26 pm

  11. Abhi,

    Actually I don’t like remote debugging capabilities. They are a security risk IMO. I prefer to SSH to the machine in question and debug locally from the command-line.

    Xaprb

    7 Nov 08 at 12:46 pm

  12. @fenway:
    Not really look at function list for functions beginning with the letter A:
    http://www.php.net/manual/en/indexes.php

    PHP designers didn’t seem to care about discoverability or usability of the language and namespacing.

    Sure you can write good or bad code in any language. Just some are better designed and a joy to use. Others should be sucumbed to better technologies.

    PHP and Perl do not sit on my list of well designed languages. I prefer to spend my time in languages that seem to be progressing forward not stuck in the 80s.

    They are still around because the amount of legacy code has reached critical mass early.

    Josh

    7 Nov 08 at 1:12 pm

  13. Josh, that’s reason #282 why PHP is less productive. As such, it is strictly off-topic in this post. Just kidding ;-)

    I totally agree with you there — it’s like someone took playing cards representing every function in every C library and shuffled them together. And the result is a very dog-eared namespace.

    Xaprb

    7 Nov 08 at 1:19 pm

  14. moto

    7 Nov 08 at 11:44 pm

  15. @Baron
    Do you replicate the request parameters by passing them while invoking the script from the command line?

    Abhi

    11 Nov 08 at 1:13 am

  16. @Josh – Although PHP seems to have borrowed a lot of perl-like concepts, you can’t lump them together at all. I think you would be slightly impressed by Perl’s design if you took an objective look at it.

    simplem

    3 Dec 08 at 4:40 pm

Leave a Reply