Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP vs Java for enterprise web applications [closed]

Is it possible to write enterprise web applications in PHP as it is in Java (with Java EE stack of technologies)? I know just a bit of PHP and I've always seen it like a request-process-response programming/scripting language with no objects staying alive on the server (like @Stateful ejbs) after the script has finished its execution.

To put it in another way: can the same web application be implemented in Java and in PHP? Or is one of the two languages more powerful than the other?

Edit: let me clarify my question: I already know Java and have some experience in enterprise web applications. I want to know if PHP is equally powerful (in language structure, in today available frameworks, and so forth) to make the same complex applications that can be done in Java.

like image 736
watery Avatar asked Jan 04 '14 16:01

watery


1 Answers

Not more powerful in the sense that you could write something in Java that would be impossible to replicate in PHP. I'm not familiar with PHP, but there's most likely similar frameworks and libraries that have been created for PHP that exist already in Java (such as an ORM framework like JPA).

Stateful EJBs aren't that special (and not that common either). You can readily store information in the session whether you're using Java or PHP.

This isn't really a suitable question for SO either, since programming languages are different and frameworks are different and you'll never find the "best" something, because that doesn't really exist.

Solution: learn both.

like image 165
Kayaman Avatar answered Sep 22 '22 23:09

Kayaman