what are the advantages of Java before php in web applications

0 like 0 dislike
7 views
Greetings to all,
but interested in the opinions primarily of java programmers,
please tell me what is in Your opinion the advantage of Java before php when writing web applications
one fact is clear — to write under the bad code with Java more difficult than php, and this is a significant argument, but what else?
php is easier to learn, examples, libraries in bulk, easier to use... the same servers in bulk, about the performance of dissent — the same FarmVille with 70 million users has php on the backends.

Does not want to plant holivar,
thank you all.
by | 7 views

7 Answers

0 like 0 dislike
The advantages of Java "actually," iron does not touch the principle. It is simply the language in which it is possible to solve in principle any problem that will work almost anywhere. The purely "ideological" aspect — it is harder to learn but easier to write, it is more logical and it does not irritate the programmer, he developed and extended "indefinitely". It's really a tool for all occasions. But his "heavy" infrastructure.
\r
PHP is simple to learn, "easy" to load, works within HTML pages. Because of what is demanded and distributed. But everything is good only in the beginning. Then the absence of strict limits becomes a source of subtle errors, and the language itself is perceived illogical and unpredictable. Large PHP projects — it is pitch black. But it also has all the rhetoric of "ideological".
\r
But in real situation it is all about the task, tools and environment. So the answer you will get :)
by
0 like 0 dislike
In the dispute between Java and PHP Python wins! :)
\r
Java heavy PHP. VPS for simple apps will be downloaded more for java than for php. And will require more memory. For complex and heavy — as it is written it will.
Yes, I have not heard about shared hosting for java.
\r
From the point of view of the development cost of PHP is better, faster and cheaper. In the case of development of large applications, it is possible to speak about prototyping in PHP, with the subsequent rewriting on a thread that compiled — it may be java. Although a bunch of python/C looks better.
by
0 like 0 dislike
>to write under the bad code with Java more difficult than php
It's just a stereotype. To write bad code in java is harder because java code any harder to write than php. Poor understanding of the PLO, coupled with his abilities in Java sometimes lead to such crooked decisions physicam never dreamed of.
I see a big advantage of Java is that skompilowany to byte-code program will run the same everywhere, while for php, a whole bunch of different updateRow.
PHP — Hypertext Preprocessor, it works great with text. This is the advantage of PHP web applications is his specialty. PHP scripts easier to write, easier to edit, there is no fact that has nothing to do with web, unlike Java.
by
0 like 0 dislike
In General in Web applications any Java before PHP no, the reverse is also true.
In Web2.0 — Java out of the box works better, but PHP already have, and most importantly(!) to twist.
In my experience I would say that personally, in my experience — the software is written in PHP usually work 3-4 times faster than (moire :) ) java applications.
And now attention a question — why.
The answer is because they are so written.
by
0 like 0 dislike
The advantage of Java is the existence of the Google Web Toolkit, which allows the same language, quite transparently, to write the server piece of the application and the client. (Including using common classes and code, and discreetly moving objects from the client to the server.)
by
0 like 0 dislike
>what about the performance of dissent — the same FarmVille with 70 million users has php on the backends.
\r
Absolute numbers say nothing, it is necessary to compare even the number of users (not hits, not to mention the scripts), related to the resources involved. Where for PHP need the cluster to raise for Java VPS will be enough, and maybe Vice versa, I don't know. He is now going back and forth between different languages, choosing what is best suited for servers with a peak at 100 requests/second, if at all really on a 4-core with 8Gb of RAM, a 40 MS per request. Some tests of Java shows about 4-fold superiority in performance before and PHP is comparable to C# in the direction that you look.
by
0 like 0 dislike
PHP have not worked (latest draft 2006), so maybe something has changed now. But overall, I still think that Java and actually typed languages (like Go, which was recently released) is better when developing large projects.
\r
When the language is typed, it is much easier to learn a third-party (and your) code or API. And in the IDE harder to make a mistake during coding.
\r
About libraries in PHP they are certainly a little bigger than Java (in web direction). But I solved this problem using RPC (not critical wastah) or using JNI (calling native C\\C++ functions through a special interface). On the other hand fundamental things like ORM or web framework made a lot more fluent.
\r
Quality made to manage dependencies, build and production of the project. Everything is automated and tuned for Java.
\r
In Java you have one process works with clients in PHP need for each client a new trial. I do not know how this affects the performance, but Java in this respect is easier to work with when writing some shared services to the customers.
\r
In the near future it will be possible to call Python, Ruby libraries or frameworks directly from Java. You can now to do it, but in Java7-8 it will be much optimized. So the problem with libraries is resolved.
\r
If you now want to start working with Java in the web, look at web frameworks Grails or Tapestry 5. The first is not quite Java (built on Groovy), but has a large number of integrations with libraries. The second entirely in Java, but less integrated libraries.
\r
Also Spring is now mainstream in the development of web projects. The above frameworks are either built on it or have the ability to integrate with it.
by

Related questions

0 like 0 dislike
1 answer
0 like 0 dislike
5 answers
0 like 0 dislike
1 answer
asked Mar 24, 2019 by kisuxa
0 like 0 dislike
2 answers
110,608 questions
257,186 answers
0 comments
32,865 users