In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly explains "which is better to compare PHP and JAVA". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "which is better to compare PHP and JAVA".
Let's first take a look at the advantages of php:
1. Php is ready to write and use
That is to say, as long as the change is completed, the user immediately sees the effect, while java is much slower. After the code change is completed, you have to compile from scratch, and then restart jvm. It takes a lot of time to restart the jvm process, and restarting the jvm process will result in user response termination.
2. Php, write quickly.
Php source code can be said to be very agile, a demand to, as long as do not think about the later function and the number of users, it is appropriate and fast, so that you can not use the framework, directly write will be very fast, write an increase correction check function, maybe 30-50 lines of code will be done. And java is much slower, first of all to think about what framework to use, now it is basically spring, and then is to configure a variety of databases, filters, servlet, decide whether to use mybatis or hibernate, and then think about the transmission between the code, and then think about business, and then keep debugging, a change to the code may be a few minutes of waiting time, incredible.
3. Php is clearer on the surface.
What is the surface of the mind, that is, what you see is the real thing, such as echo "hello world", is to output hello world, while java is different, you may write response, or write in modelattribute, or return the string, and then do not know how, it appears on the page.
4. Php takes up less memory
Php is programmed to deal with problems and takes up less memory. It can be said that you have no problem with arranging 50 items in a machine, as long as you can't get enough traffic. On the other hand, java is not good. Every time java launches a project, it has to use up a lot of memory. For example, on a machine with 8g of memory, it is almost enough to run two projects.
After talking so much about the advantages of php, doesn't java have any advantages? That's impossible.
5.java has many components
Personally, I think this point alone overshadows all other advantages. Because there are many components, it means that there are many people to use, and the eyes of the masses are discerning. Therefore, java must be good, it has precipitated too many things, not a new language can be replaced at will. What you want to do, a good look for java components, may have the function of your needs, especially with regard to the most popular big data industry, java is to occupy one side. And php is a little powerless in this scenario.
6. Java thread pool, connection pool, asynchronization convenience
In fact, this is also very similar to the first point, because there are many components, so it is easy to use thread pool to connect the pool, which is certainly necessary for scenarios with high concurrency and high functionality. Because the reason why java works is multi-threaded, you don't have to initialize many basic things every time, which saves too much time, so we can put up with the slow process initiated by the server, because it only takes one time. On the other hand, php is multi-process, and every time it needs to load all the required code from scratch, so it is impossible to keep some commonly used data in memory, and the bridging pool is not easy to do, and asynchronous operation is a big deficiency.
7.java is logical clarity in the real sense.
Because, in java, you can go from an entry to the deepest logical operation with the help of IDE tools, and you can be clear about each field, which is actually an advantage of the interface and the whole purpose. While php can not do or very few people bother to do this kind of work, php can be said to be half-purpose-oriented and half-process-oriented development, it is difficult to clearly see what the interface returns, which adds a big threshold for understanding the code.
8.java discovers errors early
It is true that compiling java takes more time, but if there is an obvious error, the compilation will not pass, which gives you a chance to check the code from scratch. And php will not, no matter how bad your writing, will not give you anything, and many times, often because of missing a semicolon, causing you to check for hours.
9.java long distance call bento
In any case, long-distance and local calls are easy to know the relevant information, and the same language calls of java do not choose authentic http calls, and maintain a certain degree of convergence, thus greatly improving the function. Php also has long-distance calls, but it is relatively weak.
In fact, there is no problem, there is no certainty of good or bad, existence is reasonable. It's just that the use of scenarios is different.
Thank you for your reading, the above is the content of "which is better between PHP and JAVA". After the study of this article, I believe you have a deeper understanding of which is better to compare PHP and JAVA, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.