which is best PHP or Java ?

by 147 comments
Friend can anyone tell me about these both language that which is best with allover performance ?
#programming #java #php
  • Profile picture of the author 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 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 ngseosept
    It's PHP
  • Profile picture of the author 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 olakh
    PHP is best.Because it is easy to implement and understand.
  • Profile picture of the author 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
    Java for me. I find Java easier to learn than PHP.
  • Profile picture of the author DEaFeYe
  • Profile picture of the author MuttelKiln
    Java is best...i will vote for java.
  • Profile picture of the author 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
    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
    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 tomdrockstar11
  • Profile picture of the author 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
    java is best for company placement and working there
    but for home designing php is the best
  • Profile picture of the author idreesfarooq
    Offcourse, PHP as it is lot easier to understand than Java
  • Profile picture of the author Jake Gray
    Java's main purpose isn't for web development.

    On the other hand, PHP is.
  • Profile picture of the author 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
    There is no best language. Always choose the best tool for the job.
  • Profile picture of the author dennyrichs
    both are better.it depends on what are you trying to do.Php is being mostly used today because of its non procedural nature.it is useful for small websites and web applications.where Java is useful for large,complex applications and for mobile development.

Next Topics on Trending Feed