Java OR PHP Server Side Web App and Why? [closed] Java OR PHP Server Side Web App and Why? [closed] oracle oracle

Java OR PHP Server Side Web App and Why? [closed]


If you're comfortable with Java, I don't see the need to learn/use PHP. There is nothing that PHP can do that Java can't.

It's true that by and large, PHP is a much more permissive language, and some tasks can be fulfilled more quickly and with less code. PHP certainly has less built-in abstraction than Java has. But if you're comfortable with Java, I'd say stick with it.

(I'm saying this as a PHP developer.)


There is a huge amount of difference between the syntax, phuilosophy and implementation of the 2 languages. I would suggest that "makes DB access protocols a lot simpler" is not a particularly good reason in isolation for choosing one language over another.

My background is as a PHP programmer, but I currently support several large Java web applications. If you were starting from the same point with both languages then I'd definitely favour PHP over Java - but a full discussion of the reasons why would take a lot more time and space than are available here. However if you already have strong Java skills, then you have to weigh up the costs of acquiring the right level of skill in PHP - due to the differences in the way these systems work, you're going to find your knowledge of Java as much of a hindrance as a benefit in achieving proficiency in PHP.

Other factors I would suggest you have a look at are:

1) architecture - PHP requires far better understanding of the underlying protocols than Java (where a lot of functionality is provided by libs/ frameworks)

2) ease of deployment

3) performance considerations - using an opcode cache means the difference between simple programs written in Java and PHP is small, since the former are usually written inside very complex frameworks, PHP can often have the edge. It certainly does not have the same complexity for memory mngmnt

4) TCO - PHPs ease of use is a double edged sword - you need to know a lot about Java just to get a program running, but the world and his dog think they can write good code in PHP. IME its more difficult to find competent PHP programmers than Java programmers.


IMHO if you know java, use JPA.

If you want to learn something new and fast prototyping, use python/django.