Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JavaEE vs PHP - why so many people thinks Java is better? [closed]

Tags:

I need to valorate what technology use for a web project, the team is composed by 4 developers and the time of the project is 1 year.

I'm more familiarized with php but the client is asking me to do it with JAVA EE.

I always have the same perception with Java and its frameworks:

  • So much xml and class in order to do simple things. In codeigniter I've to use 3 files (model, view and controller) with hibernate + spring + JSF I need more than 10 files!!!
  • An abusive use of the server. The javascript code lose importance and it's not good nowadays. Of course we can add javascript code but It seems "java web guys" prefer do the stuff on the server instead of the client.
  • Not good-looking application. Richfaces seems like a web of several years ago.
  • When I see a java application like liferay, alfresco, they looks heavy and very slowly.

I think I can be a little confused because lots of people and big companies continues using JAVA for the web. Why? it's about integration?

On the other hand Java is faster than PHP, but JAVA's servers need lots of memory (more expensive). In a server with many request we can improve with a language like php with bigger time per process and less memory per process because the server never is collapsed because of memory. Sometimes a JAVA server could collapsed because of memory and the average of response time in a real production environment would be bigger than php.

I'm really pleased with Codeigniter, why so many people thinks Java is better?

Thanks in advance,

Alberto

like image 380
alasarr Avatar asked Feb 28 '12 09:02

alasarr


People also ask

Why is Java better than PHP?

Java is used in complex projects for enterprise-level, while PHP is used in projects with less complexity and is ideal for start-ups. Java comes as a general-purpose language, while PHP was created to make dynamic web pages and is serving multiple uses now.

Which one is better PHP or Java?

Java is considered to be a more secure language, compared to PHP. It has more built-in security features while PHP developers have to opt for other frameworks. However, in terms of security, Java works better for complex projects because it can block some features in low-level programming to protect the PC.

Which is better laravel or Java?

Java is fast, secure, and reliable. From laptops to datacenters, game consoles to scientific supercomputers, cell phones to the Internet, Java is everywhere!. On the other hand, Laravel is detailed as "A PHP Framework For Web Artisans". Laravel is a web application framework with expressive, elegant syntax.

Can I use Java instead of PHP?

In a nutshell: While comparing the Java vs PHP performance, Java is clearly a winner as it is faster and efficient than PHP to write enterprise applications. Like developers have to build mobile enterprise applications to streamline complex business processes and operations.


1 Answers

well I'm not using CodeIgniter so my comparison is already incomplete.

Question one would be: why do they ask for Java? Often big companies only offer Java or .Net environments for productive systems so they might not have the people to productively run PHP applications. I know its not complicated but the maintenance people define what they are running.

Ofter people talk on languages and their features but when the first business use case has to be discussed no framework will save you that amount of time to make it count. Most programming language will somehow solve the issue.

Java is not only RichFaces or JSF. There is a lot to choose from. A LOT. Not an advantage.

Stuff often forgotten is the tool support. Java comes along with a JVM that can be analyzed in detail what it does with its memory, garbage collector, threads and so on. Profilers in Java allow you to identify almost any memory leak within a few hours. Most of the JVM monitoring works in realtime (with about 5% overhead). Talking about tool: refactoring support is far beyond what PHP IDEs come along with.

You are correct if the first look at Java compared to PHP looks like elephants and horses. (ok the logo of php is an elephant, perfect comparison...). Horses are more flexible to turn around corners but they might not carry that much around. I think from a language perspective Java is still more advanced than PHP. Namespaces, Classes, Type-Safety. These are somewhat available in PHP but still quite new.

Frameworks like Spring allow you to leverage your application on an architectural level and are more than just libraries.

I'm not the biggest Java EE fan, so I'll not complain on that.

A simple approach for you could be Tomcat+Spring+SpringMVC and a template engine for the GUIs. There is also GWT (Vaadin) if you target higher speed client behaviour (still a lot more out there).

There are lightweight approaches in Java too. I agree the standards in Java do have a more fatty tendency.

In my experience Java has no major drawbacks compared to PHP. The language choice will only affect success of the project if people come with less knowledge than required and spend too much time in learning things. And trying to find the right book about Java could be a project by its own :) (counting as an advantage)

But I have no doubts PHP would allow you to finish the project.

I would rather look into the goals and requirements before choosing the technology. This often implies or simplifies a decision.

I hope I did answer at least one question here :)

like image 152
wemu Avatar answered Sep 19 '22 22:09

wemu