which is best PHP or Java ?

Profile picture of the author divontop by divontop Posted: 07/16/2011
Friend can anyone tell me about these both language that which is best with allover performance ?
#java #php

  • Profile picture of the author AdWorkMedia
    AdWorkMedia
    It would really depend on what purpose you are using the languages for. But if you are focusing on web development then hands down I would recommend PHP. Also if you are new to programming then you may find that PHP is easier to grasp and there are also more resources available online than Java.

    Still, both are powerful languages with great performance.
  • Profile picture of the author Shilpa
    Shilpa
    For me its PHP....
  • Profile picture of the author wedhooz
    wedhooz
    you should read this article, maybe can give you another point of view between this never ending argument
    PHP vs. Java – Which One Is the Better Web Language? | OnePixelAhead
  • Profile picture of the author phpguy
    phpguy
    Depends on what you are wanting to do there is a lot less learning curve with PHP, but all the concepts are the same.

    Think of yourself as a carpenter you wouldnt use a screwdriver to hammer a nail you would use whatever tool it makes it easier to do get that nail in.
  • Profile picture of the author ngseosept
    ngseosept
    It's PHP
  • Profile picture of the author Devskumar9
    Devskumar9
    Java language is hard compare the php for learning point then php is good for the learning and jobs point of java is good compare the php because In the java lot's of software develop and website develop. Java is good for the authentication program.
  • Profile picture of the author jacobsmith
    jacobsmith
    I think php is best in web development..
    And also user friendly.
  • Profile picture of the author olakh
    olakh
    PHP is best.Because it is easy to implement and understand.
  • Profile picture of the author ApocalypseXL
    ApocalypseXL
    There is no "Best" because they are different beasts . PHP is a server side script while JavaScript (aka LiveScript) is a client side script .
  • Profile picture of the author MrPolarZero
    MrPolarZero
    Java for me. I find Java easier to learn than PHP.
  • Profile picture of the author MuttelKiln
    MuttelKiln
    Java is best...i will vote for java.
  • Profile picture of the author cordyceps75
    cordyceps75
    PHP is for web based application. Java is for desktop application.

    But Java can be convert to web based using JSP+servlet. I think the best is PHP for web based because PHP is commonly use by people around the world. Java is also good, but for the high level transactions, you must use Java for the server.
  • Profile picture of the author seamusb
    seamusb
    Originally Posted by divontop View Post

    Friend can anyone tell me about these both language that which is best with allover performance ?
    The answer to this question is - it depends.

    PHP is great for web development and quick scripts. It has plenty of available open source code (including my beloved WordPress) and is easy to learn. For more advanced programming it supports object orientated frameworks such as CakePHP and CodeIgniter. It performs well and hosting is cheap and plentiful.

    Java is a much more verbose language, is slower for development and the tools are generally more complex. The hosting is also more expensive. However, there are some frameworks and languages that use the JVM (Java virtual machine) such as Clojure and Scala that are very trendy at the moment with some developers.

    I would say that if you are going for self employed type contracts for small businesses PHP is what I would learn. Java is for more corporate work. Both perform very well in their native environments
  • Profile picture of the author wayfarer
    wayfarer
    If your question is really just about performance, then the answer is Java, which performs about 400 times faster than PHP in many cases. In a database driven website, the weakest link performance wise is the database itself, so the choice of programming language does not matter a bit when it comes to performance.

    If you are performing operations that are computationally expensive, it would be foolish to use PHP, but for most normal cases, it is fine.

    By computationally expensive, I mean, for example, a tree searching operation, which is the computation of a "tree" of unknown, or infinite size. Such operations will use 100% of your processor if you allow them to. An example of this would be searching an unindexed filesystem for specified values, or finding possible outcomes on a chess board. Java is good for this, even better would be a compiled language like C++ or C.
  • Profile picture of the author addison.agnote
    addison.agnote
    Most Java developers think that PHP is very basic, unprofessional language that can be messy, lacks structure, doesn’t have a good IDE (integrated development environment) like Eclipse or RSA, and isn’t a good platform for a real website. On the Contrary PHP developers says that Java is overly complex and cumbersome, and that it isn’t a good platform because development time is just too slow and tedious.
  • Profile picture of the author stufftheme
    stufftheme
    java is best for company placement and working there
    but for home designing php is the best
  • Profile picture of the author idreesfarooq
    idreesfarooq
    Offcourse, PHP as it is lot easier to understand than Java
  • Profile picture of the author Jake Gray
    Jake Gray
    Java's main purpose isn't for web development.

    On the other hand, PHP is.
  • Profile picture of the author williamjacob
    williamjacob
    There is no real absolute answer to your question unfortunately, because both languages have their pro's and cons.

    I use both; php for smaller projects and java for more complex or "critical" projects, generally. It is easier/faster to code in php. It just seems a bit more "amateurish" than java, and doesn't allow for robust OO coding, tier separation, and other buzz words. (I'm sure some will argue otherwise)

    One benefit of php is that it is (ironically) more portable than java, since it's an interpreted language and nearly all hosts support it. To support java, you need a JVM running and that adds extra complexity that many hosts don't want to bother with, unless you'vee got a dedicated package or some other setup that provides the JVM. Since php code is interpreted each time it loads it will never perform as well as java or allow you to catch errors at compile time (there is no compile time), although there are various optimizing and caching mechanisms to help with performance.
  • Profile picture of the author hhunt
    hhunt
    There is no best language. Always choose the best tool for the job.

Related discussions