Which one is easier to build a website, java or php
php is easier to build a website.
1. PHP is written and used.
That is to say, only one change is completed at a time, and the user sees the effect immediately, while Java is much slower. After the code change is completed, it needs to be recompiled and then the jvm restarted. The time spent in the middle is Quite a few, and restarting the jvm process will interrupt user response.
2. PHP writes things quickly.
php can be said to be very agile. Given a requirement, as long as the later performance and user volume issues are not considered, it is quite fast. You can even write directly without using a framework. It’s very fast. It only takes 30-50 lines of code to write an add, delete, modify, and check function. Java is much slower. First of all, you have to think about what framework to use, which is basically spring at the moment. Then you need to configure various databases, filters, and servlets, decide whether to use mybatis or hibernate, and then consider the transfer of codes, and then Think about business. Then keep debugging, and you can imagine that it may take several minutes to wait for the code to be changed.
3. The surface thinking of php is clearer.
What is the superficial idea? What you see is what is actually made. For example, echo "hello world" outputs hello world, but Java is different. You may write it in response. , it may be written in the modelattribute, or it may be that the string is returned, and then somehow it is displayed on the page.
4. php takes up less memory.
php handles problems in a process manner and takes up very little memory. It can be said that you will have no problem deploying 50 projects on one machine, as long as the number of visits does not increase, it can be done. But Java doesn't work. Every time Java starts a project, it has to use up a lot of memory. For example, on a machine with 8g of memory, running two projects is usually enough.
For more PHP related knowledge, please visit PHP Chinese website!
The above is the detailed content of Which one is easier to build a website, java or php?. For more information, please follow other related articles on the PHP Chinese website!