Re: Why JSP is better than PHP >>

From: Date: Mon, 13 Nov 2000 17:03:09 +0000
Subject: Re: Why JSP is better than PHP >>
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-24980@lists.php.net to get a copy of this message
> 1. Anything you can do with PHP, you can do with JSP; > the reverse is not true I don't agree with this. Ask him for examples, specific ones. I tackle HUGE web applications on a daily basis with PHP and NOT ONCE have I said "man, I wish PHP could do this ... [insert feature]" > 2. JSP is much more powerful, since it has access to > all the Java libraries. PHP only has access to PHP > libraries Oh and I'm sure PHP doesn't have ANY libraries like FastTemplate, PHPLib, etc. nor does it take advantage of WELL tested and long standing libraries that have been in the UNIX community for YEARS. Like pspell, expat, pdflib, gd, etc. > 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.) This is a valid complaint - I wish that you could be more specific when declaring variables in an Object (ie "public" vs. "private") But, this isn't a STRONG argument against PHP. Tell him good coders can easily program around this. > 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 The startup cost of JSP vs. PHP is quite a bit different. AFAIK there aren't a lot of "cheap" solutions for JSP - me on the other hand has an enterprise level solution sitting on my desktop and the software cost was $0.00! I've looked at Java nad I'm here to tell you that the Syntax is NO WHERE NEAR as easy to loarn. > 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 Funny I always thought Java programmers were a bunch of monkeys. Java is kind of the de facto standard in colleges today - anyone with some financial aid and the want to become a low life wannabe hacker can learn Java - I doubt very highly they "appreciate" the importance of OOP or strong typing. > 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. include ('foo.php'); which can be ANYWHERE on the box (hell put it int /tmp if you want) and everything in that include is then used just as if it were in that page. > 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. And PHP4 doesn't have session management? Tell him to read up on PHP4 some more. Now the idea of a variable persisting across a page, request, session, etc. is kind of intruiging, but there are easy fixes for that. I would say the safest argument is cost in the long run. On average JSP runs at about 13 pages per second, on the other hand, PHP runs at about 47 pages per second. Now lets say you buy a few nice SPARC servers to run JSP on and you load everything up you might be able to serve as many as ONE FreeBSD box running PHP! I'd like to compare the costs on your solution then. --Joe ================================================================================ = Joe Stump joestump98@yahoo.com http://www.miester.org = ================================================================================ "Real programmers don't comment their code. It was hard to write, it should be hard to understand."

« previous php.general (#24980) next »