Is Java's biggest advantage true in cross-platform ?, Java advantages cross-platform
The following is only for PC and mobile terminals.
Previously, but not now.
Cross-platform requests only involve client applications, rather than servers.For example, for desktop applications, your customers may be Windows users or Linux users. At this time, if you do not want to invest more to adapt to different platforms, the so-called "Write once, run everywhere "is brilliant. However, today, the entire software world is dumping on B/S applications (except for Embedded Systems). Even if a third-party framework, such as client cross-platform and QT, is far more powerful than Swing, it is an indisputable fact that Java has been basically eliminated in the desktop application field, and the Java-proud Applet has long been deprecated. If the client Java is a little better, it is only Android. Android initially blocked the differences between different hardware devices by JVM and achieved great success. However, today, the emergence of the ART mode in Android L is about to subvert this situation, besides, Google may also want to replace Java with its own Go language to become the first language of the Android platform. Therefore, on the client side, Java was almost defeated.
Server applications do not need to be cross-platform.As a Web server, I don't think any company will use Linux today. Will it change to Windows next month? If you just change the Linux release version, for example, from Debian to Fedora, the Linux kernel will remain unchanged in nature. Therefore, there is no problem with pure compiling languages like C ++. For gaming servers, I think I would almost always choose Linux instead of windows. The cross-platform advantage of Java has actually been greatly weakened. It can be said that it is not obvious in actual applications. In general, it is almost impossible to perceive the cross-platform feature of Java. As one of the three major commercial JVMs, JRockets only has the JVM of the compiler, that is, when the application starts, all the bytecode will be compiled into the local machine code. In fact, cross-platform is abandoned to a large extent, and the pursuit of performance.
Today, Java's biggest advantage lies in its huge and complete ecosystem.Whether a programming language is popular depends on its ecosystem. The Perfection of the Java ecosystem is embodied in the following aspects:
Java performance is high enough.Sun/Oracle's HotSpot JVM built-in JIT compiler has made great optimization efforts on bytecode at runtime. After the server application is started, the JVM should be "preheated" enough ", and provide reasonable startup parameters. If it is not a system application that is very sensitive to performance, Java is fast enough. There is a simple and feasible way to see this in the image, add+XX:PrintCompilation
We can see that the JIT compiler is busy. The demand for software is growing in the world today. When the performance is acceptable, development efficiency is the first. This is also the main reason why dynamic scripting languages such as Python are popular.
The above is only an objective analysis and does not want to cause a language war. After all,There is no best language, and only the language that best fits a project.Quote one sentence from the author :"It is reasonable to exist."