Java Servlets vs. PHP

Status
You're currently viewing only pelican's posts. Click here to go back to viewing the entire thread.
Not open for further replies.

pelican

Wise, Aged Ars Veteran
184
Hmmm... it really depends on the application you're developing for.

PHP is probably easier to develop for the newer to programming crowd in because of its simple straight forward (not requiring O-O) nature, but it's really easy to end up writing really ugly hacks in PHP if you're mixing HTML, escaping in and out all the time, and doing weird stuff in general. You just have to be careful about not making your code completely unintelligable with all kinds of crazy shit going on (guilty as charged, I am.)

For slightly better speed of execution and more object-oriented features, use JSP. But if you're new to programming, it will take longer to learn than PHP (IMHO.) Java is also an imminently more stylish technology than PHP is, and people give extra style points to Java developers. PHP is about as stylish as WalMart plastic plants in a lot of IT departments, but this reputation is probably not deserved.

As for the messy PHP-HTML code thing, I've gotten pretty good at abstracting HTML from PHP, using homemade objects and functions, and a couple of things from Sourceforge as well (PHPLIB is an excellent thing to pick up.) Distros of PHP also come with some pretty slick base classes for HTML products - PEAR. Check out http://pear.php.net or a php manual for more info on these.

Basically, JSP has some advantages, and PHP does as well. I prefer PHP because I prefer C, and it probably is just personal preference in the end.

--pelican
 
Status
You're currently viewing only pelican's posts. Click here to go back to viewing the entire thread.
Not open for further replies.