Home Java javaTutorial Is the biggest advantage of java really that it is cross-platform?

Is the biggest advantage of java really that it is cross-platform?

Nov 26, 2016 pm 01:54 PM
java 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

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Square Root in Java Square Root in Java Aug 30, 2024 pm 04:26 PM

Guide to Square Root in Java. Here we discuss how Square Root works in Java with example and its code implementation respectively.

Perfect Number in Java Perfect Number in Java Aug 30, 2024 pm 04:28 PM

Guide to Perfect Number in Java. Here we discuss the Definition, How to check Perfect number in Java?, examples with code implementation.

Random Number Generator in Java Random Number Generator in Java Aug 30, 2024 pm 04:27 PM

Guide to Random Number Generator in Java. Here we discuss Functions in Java with examples and two different Generators with ther examples.

Weka in Java Weka in Java Aug 30, 2024 pm 04:28 PM

Guide to Weka in Java. Here we discuss the Introduction, how to use weka java, the type of platform, and advantages with examples.

Armstrong Number in Java Armstrong Number in Java Aug 30, 2024 pm 04:26 PM

Guide to the Armstrong Number in Java. Here we discuss an introduction to Armstrong's number in java along with some of the code.

Smith Number in Java Smith Number in Java Aug 30, 2024 pm 04:28 PM

Guide to Smith Number in Java. Here we discuss the Definition, How to check smith number in Java? example with code implementation.

Java Spring Interview Questions Java Spring Interview Questions Aug 30, 2024 pm 04:29 PM

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

Break or return from Java 8 stream forEach? Break or return from Java 8 stream forEach? Feb 07, 2025 pm 12:09 PM

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

See all articles