Is the biggest advantage of java really that it is cross-platform?
The following discussion is only for PC and mobile terminals.
Is the biggest advantage of Java really that it is cross-platform? It used to be, but not anymore.
It is only the client application that has cross-platform requirements, not the server. For example, for desktop applications, your customers may be Windows users or Linux users. If you don't want to invest more in adapting to each platform, then Java's so-called "Write once, run everywhere" will become extremely brilliant. However, today, the entire software world is leaning towards B/S applications (except embedded). Even if the client is to be cross-platform, third-party frameworks such as QT are far more powerful than Swing. Java has basically been eliminated in the field of desktop applications. It is an indisputable fact, and the Applet that Java was so proud of has long since disappeared. If there is any excellence in client-side Java, it is only Android. Android did initially rely on the JVM to shield the differences between different hardware devices and achieved great success, but today, the emergence of ART mode in Android L is about to overturn this situation, and Google may also want to use its own Go language Replaced Java as the first language of the Android platform. So on the client side, Java is almost completely defeated.
Server-side applications do not need to be cross-platform. When building a web server, I don’t think any company would use Linux today and switch to Windows next month, right? If you just change the Linux distribution, such as from Debian to Fedora, essentially the Linux kernel remains unchanged, so there is no problem with purely compiled languages like C++. If you are building a game server, I think almost everyone will choose Linux instead of Win platform. The practicality of Java's cross-platform advantage has actually been greatly weakened. It can be said that it is not obvious in actual applications. Under normal circumstances, it is almost impossible to perceive that Java can be cross-platform. As one of the three major commercial JVMs, JRockets is a compiler-only JVM, that is, all bytecodes will be compiled into local machine code when the application is started. This actually abandons cross-platform to a large extent and pursues performance.
Today, Java’s biggest advantage is its large and complete ecosystem. Whether a programming language can become popular is mainly determined by its ecosystem. The perfection of the Java ecosystem is mainly reflected in the following aspects:
Java has the largest number of programmers in the world. It doesn't matter if you say they are farmers, but depending on the number, the most obvious effect is that when the company recruits people, it will be easier to recruit Java programmers. Just imagine if you want to make a set of software, and you have a great technical solution that needs to be implemented in languages such as C++, Scala or Ruby, but you can't recruit enough people, then the plan will most likely go to waste. At this time, your application Java can also do it, and you can easily recruit enough people, so you are more likely to choose Java.
Java has a large number of third-party libraries. If you want to parse HTML, you will probably have to write your own parsing algorithm library in languages like C/C++. But if it is Java, you can easily find JSoup on Github, use Maven to import the dependencies and get the HTML done in minutes. . For this reason, there is a saying that satirizes Java: "We don't produce code, we are just Github porters." This sentence makes sense literally, but it ignores the improvement in software production efficiency. of great value. For software development, the company's only cost is actually the "capitation fee". Every reduction in development time by one month can help the company save hundreds of thousands and tens of millions in R&D costs.
Java has a powerful IDE. Eclipse can meet almost any development need you have through plug-ins. Although it is a bit slow, you can improve the smoothness of the program through JVM tuning. Never use the default JVM parameters. However, IntelliJ Idea has completely surpassed Eclipse, and the intelligence of Idea is almost comparable to VS under the Win platform. I'm the kind of person who can't live without Vim, and there are Vim plug-ins in both IDEs to keep me alive happily.
Java has many killer applications. Needless to say, Spring, Struts, Hibernate, Hadoop, Tomcat, JBoss, etc.
Java has very few syntax features. Yes, that's a plus too. C++ adds a lot of features compared to C. Not only is it difficult to learn, but it also reduces the readability of the code when used. In fact, it is a waste of time and effort. In today's world, the requirements for programming languages are simple syntax and readable code, and performance is the next best thing. Therefore, programming languages such as Python and Ruby were born. Many people criticize Java syntax for being bloated in writing. I admit this, but the fact is that programming languages have never been eliminated because of bloated syntax. What determines their life and death is the ecosystem. For critics, here is a quote from Zhihu: “Dynamic types are great for a while, but code refactoring is a crematorium”
Java’s performance is already high enough. The built-in JIT compiler of Sun/Oracle's HotSpot JVM has made great efforts to optimize the bytecode at runtime. After the server application is started, it will sufficiently "warm up" the JVM and give reasonable startup parameters. That’s it. 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 visualize this. Add +XX:PrintCompilation to the JVM startup parameters to see how busy the JIT compiler is. In today's world, the demand for software is increasing. When the performance is acceptable, development efficiency is the first priority. This is also the main reason why dynamic scripting languages such as Python are popular

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

In this article, we have kept the most asked Java Spring Interview Questions with their detailed answers. So that you can crack the interview.

Java 8 introduces the Stream API, providing a powerful and expressive way to process data collections. However, a common question when using Stream is: How to break or return from a forEach operation? Traditional loops allow for early interruption or return, but Stream's forEach method does not directly support this method. This article will explain the reasons and explore alternative methods for implementing premature termination in Stream processing systems. Further reading: Java Stream API improvements Understand Stream forEach The forEach method is a terminal operation that performs one operation on each element in the Stream. Its design intention is

PHP is a scripting language widely used on the server side, especially suitable for web development. 1.PHP can embed HTML, process HTTP requests and responses, and supports a variety of databases. 2.PHP is used to generate dynamic web content, process form data, access databases, etc., with strong community support and open source resources. 3. PHP is an interpreted language, and the execution process includes lexical analysis, grammatical analysis, compilation and execution. 4.PHP can be combined with MySQL for advanced applications such as user registration systems. 5. When debugging PHP, you can use functions such as error_reporting() and var_dump(). 6. Optimize PHP code to use caching mechanisms, optimize database queries and use built-in functions. 7

PHP and Python each have their own advantages, and the choice should be based on project requirements. 1.PHP is suitable for web development, with simple syntax and high execution efficiency. 2. Python is suitable for data science and machine learning, with concise syntax and rich libraries.

Capsules are three-dimensional geometric figures, composed of a cylinder and a hemisphere at both ends. The volume of the capsule can be calculated by adding the volume of the cylinder and the volume of the hemisphere at both ends. This tutorial will discuss how to calculate the volume of a given capsule in Java using different methods. Capsule volume formula The formula for capsule volume is as follows: Capsule volume = Cylindrical volume Volume Two hemisphere volume in, r: The radius of the hemisphere. h: The height of the cylinder (excluding the hemisphere). Example 1 enter Radius = 5 units Height = 10 units Output Volume = 1570.8 cubic units explain Calculate volume using formula: Volume = π × r2 × h (4

PHP and Python each have their own advantages and are suitable for different scenarios. 1.PHP is suitable for web development and provides built-in web servers and rich function libraries. 2. Python is suitable for data science and machine learning, with concise syntax and a powerful standard library. When choosing, it should be decided based on project requirements.

PHP is suitable for web development, especially in rapid development and processing dynamic content, but is not good at data science and enterprise-level applications. Compared with Python, PHP has more advantages in web development, but is not as good as Python in the field of data science; compared with Java, PHP performs worse in enterprise-level applications, but is more flexible in web development; compared with JavaScript, PHP is more concise in back-end development, but is not as good as JavaScript in front-end development.

Java is a popular programming language that can be learned by both beginners and experienced developers. This tutorial starts with basic concepts and progresses through advanced topics. After installing the Java Development Kit, you can practice programming by creating a simple "Hello, World!" program. After you understand the code, use the command prompt to compile and run the program, and "Hello, World!" will be output on the console. Learning Java starts your programming journey, and as your mastery deepens, you can create more complex applications.
