which is best PHP or Java ?

by 147 replies
171
Friend can anyone tell me about these both language that which is best with allover performance ?
#programming #java #php
  • 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.
    • [1] reply
    • For me its PHP....
  • 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
    • [1] reply
    • 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.
  • It's PHP
  • 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.
    • [1] reply
    • I think php is best in web development..
      And also user friendly.
  • PHP is best.Because it is easy to implement and understand.
  • There is no "Best" because they are different beasts . PHP is a server side script while JavaScript (aka LiveScript) is a client side script .
    • [1] reply
    • Java and Java script are not same. They are totally different.
  • Java for me. I find Java easier to learn than PHP.
  • Banned
    [DELETED]
  • Java is best...i will vote for java.
  • 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.
  • 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
  • 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.
  • Banned
    [DELETED]
  • 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.
  • java is best for company placement and working there
    but for home designing php is the best
  • Offcourse, PHP as it is lot easier to understand than Java
  • Java's main purpose isn't for web development.

    On the other hand, PHP is.
  • 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.
    • [1] reply
    • Actually You can build robust OOP with PHP if you know how. It's not hard at all just takes more time imho.
  • There is no best language. Always choose the best tool for the job.
  • 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.
  • Ofcourse this depends on what you shall do. PHP or Java, try them both and see which one you like.
    • [1] reply
  • Banned
    This thread is totally pointless! You are trying to compare apples to oranges here.
  • PHP is normally used for short term projects because the coding style is a bit crude and hard to maintain since you have to repeat codes over and over again.

    Java can be used for bigger projects because you can use frameworks like Spring & Hibernate or Groovy & Grails to make code repetition lesser and to make it easier to maintain the project in case you need to revise it in the future (or if there are scope creeps)
  • Languages are simply tools that you can use to solve problems. As all things under the sun they each have their strengths and weaknesses. Java is an all purpose language that is massively popular in the corp world. You can make most anything with it.

    PHP is a language built for the web.

    So, if you're thinking about building desktop apps, then Java is the way to go. Internet stuff, PHP all the way. But really, it comes down to personal preference in the end.
  • There is relay no 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 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, although there are various optimizing and caching mechanisms to help with performance.
    • [1] reply
    • PHP and java both are best programming language. According to me, Java is a better then PHP. Java is a very simple and easy programming language. really i like to use only the java.
  • If you are aiming to make software or web apps or combined web app that is a software then i think you should go for java,you can also do peer to peer programming in java.
    If you simply want to make a website or a simple web app than go for php.
    Php is easy to learn,and you can see great examples of web apps and websites made in php like facebook.
    One more thing finding good shred hosting for java is difficult than finding good shared host for php.
  • I think java is best.........
  • Java is best forever.
    • [1] reply
    • it depends on the purpose you'll be using it for. php rules for web dev.
  • Banned
    [DELETED]
  • Banned
    [DELETED]
  • 3 years ago I would have said Java hands down. However PHP has really come a long way in closing the gap. Today, my first choice for server side development is PHP, no question!
    • [1] reply
    • Between PHP and Java, I prefer PHP.

      Between PHP and Perl, I prefer Perl.
  • i think php is more better tha java
  • PHP is best
  • Java would definitely not be the language but yes JSP can be an option but still I would go with PHP as I know to an extent PHP but not JSP.Java and PHP have very different uses to achieve optimum efficiency and what one is good for the other may not be.
  • PHP is the best and it is open source to study easily...
  • PHP and Java both have there own features for which they are know. Comparing them is of no use but if you are new to the programing and designing world prefer php as it is a bit less complicated compared to JAVA.
  • i think php is the best
  • Ruby on Rails. 'Nuff said.
    • [1] reply
    • Banned
      [DELETED]
    • I second that. Rails has made such an incredible development in the last years, it's lightyears ahead of any other framework I have used.
      Because Rails is so powerful, it has also quite a steep learning curve, but there is a crazy active and friendly community out there and it's almost hard to find problems that haven't yet been solved by somebody else.
  • Comparing PHP and Java is almost like comparing apples and oranges. You can have php programming with Java script on your website. It all depends on what you want to do, but the programs are different.
    • [1] reply
    • Comparing Java to Javascript is like comparing apples to butternut squash. Java is a byte-compiled statically typed language with C-like syntax and OO features. Javascript is generally only used for client side scripting in web browsers and is a duck-typed, dynamic, prototypal scripting language.
  • The purpose of both the languages is different. Java provides better authentication. Java language is tough to learn than PHP. PHP is quiet simple and easy to understand.
    • [1] reply
    • Also, MongoDB is the secret ingredient in the webscale sauce.
  • I am a java programmer mainly, but I’ve been looking at a lot of posts of java vs php, and all of them say that java is more for the enterprise than php, but give NO reasoning for this.
    • [1] reply
    • Banned
      [DELETED]
    • Many would say Java But as for me and i have tried this one PHP is the best. If i were you take to account those who really used this one.
    • Banned
      [DELETED]
  • I vote for Python - but learn both.
    Since PHP is very straight forward and the learning curve is a little steep for Java, you may get frustrated and stop working with Java. Then as you learn more about programming and PHP, you'll pick up the java book again and have a better chance at learning it. Good Luck
    • [5] replies
    • First of all decide why you want to learn the language.

      Then it is easy for you to decide which is best for you
      • [1] reply
    • As per my opinion So PHP is best because PHP is easy to understand and use.But if any buddy want to use flash effect in the website so java is best.
    • Banned
      [DELETED]
    • Banned
      [DELETED]
    • I think PHP is best programing language because PHP is easy to learn.PHP and JAVA is open source.So it's very secure and provide excellent feature but Java is very toffees language.I currebtly use for PHP language.I think PHP better then Java.
    • Banned
      [DELETED]
    • Both have its importance and advantages.
      Java is a vast field but PHP is not.
      PHP is cheap to create website so it is preferred over java.
    • Banned
      [DELETED]
    • I think both are important for developer but there are some difference between them which are mentioned you can say java is best.
      php is open source you can use php without license
      java which is developed by sun micro system so you need to valid license for doing work.
      java can provide better Tech support for software development.
      java can give the more security than php
      java coding is more complicated than php
      php is best for small project
      java is best for large project
      you need java virtual machine platform for working in java
      you can easily download dreamweaver for php development
      mostly mobile phones use java applications for security purpose
      we can give more authentication by java such as games, software etc
      so java is better than php..............
  • The Java language is difficult to compare learning points, then PHP is the point of Java is a good study and work more PHP PHP, because a lot of software development in Java and Web development. Java is a good validation process.
  • I think PHP is better than JAVA. PHP is originally designed for web development. PHP. PHP is the programming language is object oriented and all major web technologies development. For best performance combination of Apache and PHP is more appropriate than others.
  • PHP is better for small web development applications and websites, and we can easily get customized solutions and platforms for php through which one can easily manage the website. Whereas Java is good for desktop as well complex applications and data management is quite complex in case of Java.(JSP's)
  • if your criteria is performance then php might be a better language. if you plan on regularly updating for a long time then a more structured java framework may be useful.
  • PHP and java both are the best programming language but the thing is which language you like the most. According to me Jave is one of the best programming language and it has a more demand.
  • PHP and Java both are the best language. In today's time the demand of these language is very hight. According to me PHP is best and more beneficial also.
  • Both are the best.PHP is server side embedded scripting language.It generate the dynamic webpage.Java is run time
    • Banned
      [DELETED]
      • [ 1 ] Thanks
  • For web programming for a whole site, I would recommend PHP, but if you have a site and want to add to its functionality, JavaScript may be the way to go. It really depends on what your needs are.
  • Php has no competition with java. With Java , you can do virtually nething! Php is only focused on web d.
  • Java very difficult to learn and use,I learned about Java (JSP) but now i use php because php easy use on all window or linux.
  • I'll say this much.. it totally depends on the application and the platform. For most small websites, there is zero reason to consider java. For some larger scale websites, java is doable.. but rarely the best choice. IMHO java's place is in middleware and widgets.
  • This is like comparing apple to pear.
  • Both are very good languages i recommended both of them
  • I think at this point of time, it important to distinguish between Java and JSP also.
  • Banned
    [DELETED]
  • There is nothing like best when it comes to development. Choosing the best tool is what matters. PHP is good when relates to website development to dynamic sites.

    Java is very good for application development purpose. JSP is a very good part of java, but getting degraded now a days. Java is also useful for application development for handheld & other small devices. (J2ME)
  • I like Java is the best programing language.Java language coding help to make computer games.Java coding also helpful to make mobile graphics.
    • [1] reply
    • Well, I think PHP is better and easy language. With PHP, you can create dynamic websites with fun, interactive tools and features, such as discussion boards, photo slide shows, and local weather updates. It is a pleasant experience as the first step in the programming world. The character combined with its easy online potent enough to leave you stunned.
  • Php is better than java
  • It really depends on your requirements for the web most of the time php is good to develop websites
  • For me PHP is Good its easy to understand. I love PHP scripts to design websites.
  • You can't compare PHP and Java, both are designed to do different things.
    PHP runs on your webserver, orgainzes and then gives a reply back to the client with info.
    While in java, anything takes place on the client's pc so you need to know what you want to do with it so you can decide what's best for you.
  • Java is much better than PHP...i always use java
  • [DELETED]
  • Lol... PHP is the greatest invention in the Internet world for the last years. It's easy, understandable and you can create great things with it! Why isn't Facebook written in Java, what do you think ?
  • Why this discussion? You cant compare both of these languages.. Php and Java, first of all php is not a lannguage, its scripting languange, and java is full flashed language.. Both of them have some great use in their respective fields..
  • Both Languages are good for me .....
  • I would suggest you PHP. If you are beginner and want make websites then PHP is best choice for you. PHP is very easy to learn and open source language. Jave is very tough compare to PHP. Java is used for developing robust and platform independent application.
  • it will depand on pupose of project work but jave is best
  • For me, it really depends on what you are trying to achieve with both programming lange. It is it easier to grasp PHP and you can also find alot of free resources.
  • Banned
    [DELETED]
  • According to me you can't compare two languages just by saying there name ,if you want to compare two languages you must implement them on the same subject and then only you can see which is give you more benefits. then,only you can compare the languages ...
  • its depend on your purpose and need if you make a web site the structure should be made in php if you want design it then you can use the java,so in my point php is much better than jawa
  • [DELETED]
  • PHP for Wordpress hacking/tweaking, Java/Javascript for special functions.
  • I would go fit php, if you want a quick start to a web site, start off with a platform like Wordpress or Joomla! and develop your own plugins, that way you get all the common web requirements like logging in for free.

    Plus you can then share your work.
  • For me.... Php
  • Both are well known and well popular language and each of it's has it own feature. Php is a technology and it is used for web development. while Java is language and it is used for application development. PHP is open source product while Java is product of Sun Micro System.
  • Banned
    [DELETED]
  • Web development - go PHP. It's easier to understand but it depends on how you want to use it. I find Java difficult to learn but it's great if you will learn it.
    • [1] reply
    • Both are very good languages i recommended both of them
  • Banned
    [DELETED]
  • Both languages serve their purposes. If a programmer is proficient in both languages, then PHP is almost always quicker to prototype with. First and biggest difference, you don't have a notion of application in PHP. Each page is a script, executed in its own memory environnement. That means PHP is great for dynamic web site, whereas server Java is for server-centric applications, which is a different class of problem.
    • [1] reply
    • I use both of them. For me java is good for big application or for corporate
      that have many important transactions, because java provide many API for
      security, but java also need big resources.

      php is very good if you just want develop personal websites or small-mid
      websites, because it doesn't have big resources and you can quickly develop
      your application/website.
  • Banned
    [DELETED]
  • Banned
    [DELETED]
  • I reckon he meant to ask PHP or JAVA SCRIPT isn't it?
  • First tell me which one is better Pastry or Patties?

    Thanks
  • I think both of them Good.

    I use Both Of them..
  • I think you should clarify your question to be "what is best for what?". Because php is for web programming and java is for bigger thing. So each one is better than the other when use in appropriate case.
  • Banned
    [DELETED]
  • i am php coder but i don't like php sometimes , of course java is better bacause java can create program for desktop application. java is for server side and client side... but php just is for server side.
  • php for me .. don't know about java
  • PHP is a great programming language, especially if you're an internet marketer.
  • Banned
    [DELETED]
  • The answer is simple, PHP is easier to learn and use while Java is more interesting to learn and use.
    • [1] reply
    • If you're new to programming, definitely PHP. Most shared hosting accounts support PHP. Java is great, but is much more complicated for someone new to development to learn. You'll also need to make sure that your hosting provider supports it. Java requires an app server like Tomcat to be running on the web server in order to deploy your java apps.
  • Banned
    [DELETED]
  • Banned
    [DELETED]
  • PHP is much simpler, Java is for banks, goverment and big companies
  • Java is much havuer and takes more time to learn. PHP - it took me 20 minutes to start programming
  • There is no real absolute answer to your question unfortunately, because both languages have their pro's and cons.
  • it is quite an open ended question to reply but here's my 2cent ;-)

    For some PHP might be better since it is more rapid - you open up an editor place some statements, put them on a web server and you start seeing results.

    Whilst PHP is very very powerful and there are millions of websites running on PHP, Java is more robust, more salable and there are more projects that you can use to enhance and build your projects with.

    But as has been said - it really depends on your capabilities, skills and what you want to achieve :-)


    I have worked with both: for small project I will opt for PHP. For larger projects I will go for Java
  • Hi in present PHP is mostly much better then JAVA because in business market everyone prefer to php.
  • @jasonbourne9839 - PHP has OOP constructs which you can use


    @wondershar - Good point - if in business a language is preferred more than an other then it is considered to be better. But rest assured that in some areas Java is considered a standard
  • Banned
    [DELETED]
  • If you talking regarding website development than PHP is very best, it is website development language and it is free open source language, it is very best with combination of mySQL database also.
  • Banned
    [DELETED]
    • [1] reply
    • PHP is better for internet marketers in most cases. Java is better when you want to make platform independent software. PHP is faster for websites
      • [1] reply
  • I suggest you to take php, its easier to manage compared to java.
  • I think both have equally good.
  • Both language has its own importance, it completely depends on your comfort level. Some people think Java as easier whereas for some people the case is viceversa. It all depends on how deep you want to go with a particular language.
  • Without a shadow of a doubt, Java.

    You also need to think about long-term security and earning potential. Everybody knows PHP, the market is saturated with PHP developers. Java is more enterprise and Java based positions generally pay more. If you went into employment, almost all large companies are looking for Java developers.

    Take a look at Ruby and Python as well.
  • Both languages working purpose is different.
  • I think PHP is better for website developement. But you'll be better if can use both of them.
  • Definitely PHP is better. It is free and lots of resource online if ever get stuck.
  • You can't compare PHP & Java because PHPO is server-side and JAVA client-side.

    You can use these 2 language in combination. There is very powerful.

    I hope this help
  • Both are the best but my favorite is PHP.
    • [1] reply
    • I think PHP is better for small and medium web projects. PHP is born for web while Java was invented for application programming, then the Java developers added support for web but it is cumbersome and I hate it.
      If you have a big project, Java could be better in performance because Java Enterprise is more scalable then PHP.
  • It is depends on requirements and if you are selecting PHP language for development than mySQL database is very suitable with PHP language, if you are selecting JAVA language for development than msSQL is very suitable with JAVA language.
  • It depends on what you actually want to do with your language. If you want to create awesome, secure, server run applications then PHP is the name of the game. If you want dynamic, user-oriented, and potentially malleable products then Javascript is the way to go.

    What is important to note, in either case, is that neither of them are really important anymore. What is truly important is your syntax for HTML5 to insure that you run equally well for both mobile and desktop based products. A well designed HTML5 website can now run just like a native app on most mobile systems, as well as many desktop browsers (IE, Chrome, and Firefox all have extensible HTML5 native-support).

    But to truly have a secure and dynamic HTML5 website, you are going to need PHP, Javascript, as well as the basic HTML5 and CSS3 knowledge needed to put together a proper application.
  • Banned
    [DELETED]
  • Yes, I do really hate Java's high price tag, as well as the inability to connect to my WiDi on my laptop like PHP does.
  • depends on the purpose
  • Banned
    [DELETED]
  • Depends mainly on the purpose and what you want to achieve. Both are great tools.
  • It's a religious war. ;-)
    • [ 1 ] Thanks
  • Banned
    [DELETED]
  • I recomended Java because java can run on dekstop, mobile and web, but PHP easier than java..
  • Banned
    [DELETED]
  • Banned
    [DELETED]
  • Its PHP if you are focusing web development.
  • php is easy to learn but java is vast compare to any programming language
    baut it depend upon u what u want to do.
  • Banned
    [DELETED]
  • Depends on what you are doing of course. PHP is the standard in web development, and Java is good for Mobile Apps.

    This is apples to oranges, a better question would be Java vs C# and PHP vs ASP.net.
  • Hello..
    Compared to PHP Java will lead however the comparison is not very good here because they are both very different..
  • I am not sure what exactly your pupose behind this question? Would you like to learn or you like to developed something ?

    Apart from this its totally depends on for what is your aim like if you like for mobile then Java would be best..on other hand you just want to make quick website then PHP is better after all benefit is open source solutions such as WP,joomla..etc.

    But if someone ask me to compare all aspects then I must say JAVA is the good ..becusae statistics shows JAVA has worls class application which PHP probably doesn't have..but every man has own choice but if you like to learn then must start with PHP because JAVA is advance than PHP.
  • Banned
    [DELETED]
  • Java for standalone app, php for web based. A mix for both.
  • Some people like Java and some like PHP, everyone is professional in their own field.it depends on you which field you like. i recommended you both,choice is yours.
  • PHP is best.PHP stand for php hypertext preprocessor. php programing language is easy language.HTML tags use in PHP.this web page using post method.php is HTML script.PHP offers many advantages-it is fast,stable,easy to use and open source.
  • Banned
    [DELETED]
  • I would go with with Java
    I start learning first HTML then i learned Java , em not a professional but just know little bit about it.
  • Java is a programming language created by Sun Microsystems. Java is used mainly in the Internet and uses a virtual machine that has been applied in most browsers to turn Java into a specific application on different computer system.
  • Banned
    [DELETED]
  • Though both of them are founded on object oriented feature but in application level those have completely different taste and appeal. PHP is a scripting language used for web based programming. Java can be used almost for all purpose.
  • Banned
    For website and service PHP is the best ,
    and for stand alone and game programming JAVA is popular.
  • What do you want to do with php and with java? Thats is a question&

Next Topics on Trending Feed