[ale] J2EE vs PHP

Fletch fletch at phydeaux.org
Thu Mar 11 17:50:23 EST 2004


>>>>> "Ronald" == Ronald Chmara <ron at Opus1.COM> writes:

[...]

    Ronald> Now the author might simply have realized that every
    Ronald> language has multiple deployments, and thus coded for in
    Ronald> such a way as to test what deployment is in use, or coded
    Ronald> for the lowest common version.... but no, PHP is faulted
    Ronald> because in the computer world, there are versions of
    Ronald> software!  Oh my!

The main reason I've seen cited for this issue being a problem is that
PHP (apparently, from my readings) has a bad history of interface
drift between versions, with things changing without any deprecation
even between minor versions.

[...]

    Ronald> target-specific items as runtime requirements. If one
    Ronald> doesn't know what version of perl is going to be in use
    Ronald> (with what CPAN modules), or what version of java is in
    Ronald> use, or what version of bash is in use, is the *language*
    Ronald> at fault because the programmer is choosing to use version
    Ronald> and implementation-specific features?

If the language itself mutates significantly enough between versions
that there isn't a stable target to code for I'd say yes it's a flaw
in the language.  As a point of comparison, probably 85%-90%+ of code
written for Perl 4.0.36 (which is going on at least 10 years old)
would run without changes under the latest 5.8 (and the one big change
that it might need would be "foo at bar" to "foo\@bar" since arrays now
interpolate in ""'ed strings).


[...]

    Ronald> Personally, I prefer PHP, but that's all about how I
    Ronald> program, and I haven't seen a whole lot that I *can't* do
    Ronald> (on an application level) in PHP. 

I hear some people love Visual Basic, too.</minor flamebait> :)


Neither the article nor I ever said you couldn't do things in PHP, but
rather that the language itself doesn't lend itself to some things
(say, writing a Gtk+ GUI app . . .).  But I'll personally just stick
to Perl where I can use either m//, s///, or index() rather than have
to try and memorize which of the 20+ functions behaves the way I want.


                         replaces case                 gives   s/m/x offset
                 matches with     insens number arrays matches flags (-1=end)
ereg             ereg             no     all    no     array   no    0
ereg_replace     ereg    str      no     all    no     no      no    0
eregi            ereg             yes    all    no     array   no    0
eregi_replace    ereg    str      yes    all    no     no      no    0
mb_ereg          ereg[1]          no     all    no     array   no    0
mb_ereg_replace  ereg[1] str/expr no     all    no     no      yes   0
mb_eregi         ereg[1]          yes    all    no     array   no    0
mb_eregi_replace ereg[1] str      yes    all    no     no      no    0
preg_match       preg[2]          yes/no one    no     array   yes   0
preg_match_all   preg             yes/no all    no     array   yes   0
preg_replace     preg    str/expr yes/no n/all  yes    no      yes   0
str_replace      str     str      no     all    yes    number  no    0
str_ireplace     str     str      yes    all    yes    number  no    0
strstr, strchr   str/char         no     one    no     substr  no    0
stristr          str/char         yes    one    no     substr  no    0
strrchr          char             no     one    no     substr  no    -1
strpos           str/char         no     one    no     index   no    n
stripos          str/char         yes    one    no     index   no    n
strrpos          char[3]          no     one    no     index   no    n
strripos         str              yes    one    no     index   no    -1
mb_strpos        str[1]           no     one    no     index   no    n
mb_strrpos       str[1]           yes    one    no     index   no    -1

[1] Handles multi-byte characters
[2] PCRE regex: so-called "Perl compatible" regular expressions.
[3] Also does strings in PHP 5


Chart snipped from http://tnx.nl/php.txt 


At any rate, I'll stop now.


-- 
Fletch                | "If you find my answers frightening,       __`'/|
fletch at phydeaux.org   |  Vincent, you should cease askin'          \ o.O'
                      |  scary questions." -- Jules                =(___)=
                      |                                               U



More information about the Ale mailing list