Re: Why JSP is better than PHP >>

From: Date: Mon, 13 Nov 2000 17:42:49 +0000
Subject: Re: Why JSP is better than PHP >>
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-24993@lists.php.net to get a copy of this message
On Mon, 13 Nov 2000, Erick Papadakis wrote: > 1. Anything you can do with PHP, you can do with JSP; > the reverse is not true No. If you think that PHP can't do something, it's just because you don't know how to do it. > 2. JSP is much more powerful, since it has access to > all the Java libraries. PHP only has access to PHP > libraries Oh, is that all? 14 DB libraries, 2 spell-check libraries, 2 PDF libraries, 2 RE libraries, 2 online payment libraries, libraries for FDF, Flash, XML, WDDX, NIS, CCVS, arbitrary-precision math, MCAL, Gettext, Recode, plus PHPlib, PEAR... PHP is the Perl of inlime HTML languages. > 3. JSP is Object-Oriented, so leads to cleaner code > that's easier to debug, maintain, and improve. (PHP > also allows objects, but the object model is more > primitive, and most scripted pages ignore PHP objects > and just use normal variables.) The first point is valid. PHP still lacks destructors and private variables. The second point is subjective. If a developer uses PHP in a structed or OO way, then BFD. It's the "C++ == C with classes" argument that keeps popping up. > 4. The equivalent syntax in JSP is just as simple to > learn, so you can get up and running just as quickly > -- that is, there's no extra startup cost in using > Java, at least not a significant one And vice versa. > 5. Java programmers (as opposed to 15-year-old hackers > or HTML monkeys) appreciate the importance of a clean > language with complex OO data structures and strong > typing Again, a programmer will use whatever style they feel comfortable with, and not have to be shoehorned into one or the other. > 6. With JSP, if the code inside a page gets too big, > or if you want to use it elsewhere, you can cut it > out, make it into a Java class, and invoke it from > anywhere in your application (even not from a page). > With PHP, you're stuck inside the HTML box. As oters have said, (include|require)(_once)?. 'Nuff said. > 7. JSP's concept of state management and persistence > is more explicit and powerful than PHP's. With JSP, > you can specify whether a variable persists for the > page, the request, the session, or the application (or > if it's just local to the function). The JSP engine > automatically does the right thing with cookies so you > have access to the variable on later requests. With > PHP, you just have "global" and "not global", you > don't have automatic session management, and have to > do your state thing manually with cookies or hidden > variables. I bet you that JSP does all their "state things" with cookies, exactly the same way as ASP et al. There's simply no way around it. I don't think this person has looked into PHP in any great detail, at least not since 3.0.4 or something like that. -- Ignacio Vazquez-Abrams <ignacio@openservices.net>

« previous php.general (#24993) next »