29 sept 2009

Why PHP is not my favourite language?

Because I'm not a web application developer; I'm an enterprise application developer, who sometimes writes Web apps. So I use Perl.

What are your reasons?

2 comentarios:

  1. Mostly because of the things that Perl has and PHP doesn't. It's not that PHP is "evil". That trap is so easy to fall into. But:

    - No map
    - I hate all the variations on sort
    - (proper) closures
    - a lack of a central code repo (PEAR and PECL not withstanding)
    - a lack of "best practices"
    - not a big testing culture (though there is movement in this)
    - wheel reinvention; this goes with the lack of a central code repo (everyone redoes everythign)
    - the use of one data type for both indexed and associative data structures

    That being said, for most PHP apps, deployment is dead simple.

    ResponderEliminar
  2. I dislike php because you can do the following is incredibly hard to debug, and the interpreter will silently go on without any warnings or errors:

    $ZipCode = '90210';

    ...
    ... lots of code

    print "the zip is: $ZIPCode\n";

    In my opinion this is fundamentally broken, and I will have a hard time convincing myself to use php for any reason because of this.
    This is solved with one line in perl5:

    use strict;

    I was also surprised that ruby and python while they would fail on the above sudo code, they wouldn't fail on the following case:

    zipcode = database_row[zipcode];
    if(new_data_is_entered) {
    zipcdoe = new_zipcodel;
    }

    In both ruby and python, every assignment translates to "my variable = ".

    ResponderEliminar