aspose file tools*
The moose likes PHP and the fly likes php vs java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Languages » PHP
Bookmark "php vs java" Watch "php vs java" New topic
Author

php vs java

Abhilash Etikala
Ranch Hand

Joined: Nov 08, 2009
Posts: 38

Hi to everybody,
I am studying my final year engineering(computer science) so i am handling a Indian Government project.Project is dealing within a certain security issues and a part of the project has been already implemented using PHP but i want it to be completed in JAVA and i need to know the differences between PHP and JAVA with certain issues like
1.security
2.flexibility
3.compatibility
4.scalability
5.connecting various databases
And finally,using the above issues please explain me which is better JAVA or PHP or any other suggestion for my project .

Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

I could type all day and not answer this completely. Given the topics you stipulate:

1.security

Both languages can be secure or otherwise, depending on how you use them

2.flexibility

Both languages are flexible or otherwise, depending on the architecture of your application

3.compatibility

Both languages can run on a multitude of platforms and can interact with a bunch of other technologies

4.scalability

PHP tends to lose out here. That being said I know of a bunch of fairly big organisations who back their online shops with PHP

5.connecting various databases

You can connect to databases from both.

I think your major driver here is that part of the project has already been implemented in PHP. Why throw that away?

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18124
    
    8

Paul Sturrock wrote:I could type all day and not answer this completely.


Yes, that would be a pretty good magazine article (if we still had magazines). At least 2,000 words and probably more. Asking somebody on a forum to write such an article for a non-paying audience of one is a bit audacious, I think.
Pat Farrell
Rancher

Joined: Aug 11, 2007
Posts: 4637
    
    5

are you really "final year engineering(computer science)"

I would hope that by the time an engineering student is that far along, they would know the answers, and would at least provide a complete description of what you mean by vague topics such as "security" There is enough material in that one word to fill up a Masters Thesis.
Abhilash Etikala
Ranch Hand

Joined: Nov 08, 2009
Posts: 38

Hi everybody,
are you really "final year engineering(computer science)"

Iam Engineering Student only sir.i know the security issues but iam not as experts.iam with less feasible experience on handling such type of project.So iam taking suggestions from such experts from this community.


Paul Sturrock
PHP tends to lose out here. That being said I know of a bunch of fairly big organisations who back their online chops with PHP

Thank you sir for valuable suggestions and please can you explain the scalability of your point of explanation clearly.So that i can convince my professor to go with java than php.
K. Tsang
Bartender

Joined: Sep 13, 2007
Posts: 1966
    
    7

Hi there, in general I agree with Paul. It will take several pages to completely compare PHP and Java.

IMO it really depends on 1) the project goal (what you are building) and 2) how "should" the project be designed or architected?

Currently in today's development, PHP has many frameworks to choose from eg Joomla, CakePHP, Prado, Drupal, Wordpress, etc. Each has its own strength or purpose. Is your existing PHP using such framework? As for Java enterprise application, it comes down to Hibernate+Struts2+Spring2 with or without EJB.

Now design issue. Well it somewhat depends on the framework you choose. How such and such framework be tweaked to do abc. Can the framework do xyz or is there a external plug-in or module so you don't need to write it.

Also don't let expectation hinder your decision at first. I experienced a case where at first the client just wanted a "easy to maintain" website. Then as time progressed, they wanted more (demanding features).... ultimately what they really want is a CMS. But at the very beginning the framework for the website is NOT a CMS. Oh I wasn't the person who started the website.

So do consider what may be right now may not be right as the application grows or simply client increases expectation.

Also if you were the client would you switch to java just for the "more" X (security, scalability etc)? Also Java app hosting usually cost more because you need 1) more memory and 2) app server.

Hope this helps.


K. Tsang JavaRanch SCJP5 SCJD/OCM-JD OCPJP7
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15286
    
    6

K. Tsang wrote:As for Java enterprise application, it comes down to Hibernate+Struts2+Spring2 with or without EJB.


100% NOT TRUE. There are many more choices than what you listed here. Better choices, in my opinion.


GenRocket - A Test Data Generation Platform
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60050
    
  65

Gregg Bolinger wrote:
K. Tsang wrote:As for Java enterprise application, it comes down to Hibernate+Struts2+Spring2 with or without EJB.


100% NOT TRUE. There are many more choices than what you listed here. Better choices, in my opinion.

Indeed. The assertion is rather ridiculous.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
K. Tsang
Bartender

Joined: Sep 13, 2007
Posts: 1966
    
    7

OK I may be over-simplify with Java frameworks but that's the trend "these days".
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15286
    
    6

K. Tsang wrote:...but that's the trend "these days".


According to?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60050
    
  65

Still disagree. Some of those technologies may be popular, but that combination is hardly "the trend".
Abhilash Etikala
Ranch Hand

Joined: Nov 08, 2009
Posts: 38

Hi,
i agree with K. Tsang that goal of the project makes the difference but as i said it is already implemented in php and moreover the project was a simple client-server application which mostly consists around 10 to 15 pages which takes the input and displays the results with some logic, it doesn't use any frameworks but now the application goes big.I have to go with any of the frameworks.


Can anybody suggest which framework is better and it should be advantageous to me in my career.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60050
    
  65

For PHP, or for Java?
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15286
    
    6

We get the "which framework should I use" question a lot. The most recent entries are:

http://www.coderanch.com/t/474309/Application-Frameworks/Application-Frameworks/Search-Framework
http://www.coderanch.com/t/474302/Application-Frameworks/Application-Frameworks/Framework-small-medium-application
http://www.coderanch.com/t/471590/Application-Frameworks/Application-Frameworks/Which-framework-learn

And the answers given which can be summed up with "We can't tell which framework you should use" apply to any language (php, java, etc).
Abhilash Etikala
Ranch Hand

Joined: Nov 08, 2009
Posts: 38

For PHP, or for Java?

for php...sir...


Thank you Gregg Bolinger...for valuable suggestions...
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60050
    
  65

Well this isn't exactly a hotbed of PHP gurus. Perhaps you should be asking on a PHP forum?
Rahul Sudip Bose
Ranch Hand

Joined: Jan 21, 2011
Posts: 637

K. Tsang wrote:
Also Java app hosting usually cost more because you need 1) more memory and 2) app server.
Hope this helps.


Looks like a disadvantage to me. Can anything offset this ?


SCJP 6. Learning more now.
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Personally, I'd ask K. Tsang to back this up. You may need more memory or you may not. It depends how you have designed and written your application. You cannot make sweeping statements like "Java uses more memory". That aside, given the comparative costs of development resources and buying more memory, if it were true would it even matter?

There are plenty free app servers outs there. And it's very debatable if you need one for your Java application anyway.
Minal Dussal
Greenhorn

Joined: Apr 01, 2012
Posts: 2

Java is client based and php is web based language. Java is used for developing software that runs on computer and php is used for developing web sites.
Matthew Brown
Bartender

Joined: Apr 06, 2010
Posts: 4240
    
    7

Minal Dussal wrote:Java is client based and php is web based language. Java is used for developing software that runs on computer and php is used for developing web sites.

That's completely untrue. Java can be used client side, but the vast majority of Java code out there is server-side.

(Edit - OK, "vast majority" may or may not be true! But it's probably the most important current use of Java.)
Pat Farrell
Rancher

Joined: Aug 11, 2007
Posts: 4637
    
    5

K. Tsang wrote:OK I may be over-simplify with Java frameworks but that's the trend "these days".


Actually, one of the industry's common complaints against Java is that the frameworks are huge, hard to setup, hard to use, and generally difficult to develop with. Its not a fair complaint against Java the language, its really the fault of bloatware frameworks.

People who think that these huge frameworks are the answer are asking the wrong question.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: php vs java
 
Similar Threads
I need a good resource for understanding JAAS
security and other aspects
how to invoke an application from within an applet
Java GUI and Security
Cannot find any provider supporting AES