I am a Java opponent, as for why, I think the biggest reason is that it is not real, regardless of what Sun said some of the words, or now some of the Java user's remarks, there is a suspicion, and even a lot of false, and these words are endless, in fact, the language itself I do not want to say anything, Any language exists for its own reason, and there are applications for it, but if it's always exaggerated, it's unpleasant.
First, Java is simple
Java simple, anyway, I do not think, of course, this is the Java just came out, at that time it seems to be reluctant to say the past, but this sentence is still quoted, and is always in contrast with C + +, can not be said to be simpler than C + + is called simple bar, would someone think there is more complicated than C + + language There's obviously a problem with this contrast.
二、一次 compilation Run Everywhere
This sentence should have a premise, that is, as long as the platform has a JVM, but I do not want to look for loopholes, so there is no convincing, I think this is not a good thing, first of all for scripting language, once written (do not need to compile) run everywhere, it is not more advantage, However, there is no scripting language to take this out of the matter, why Java always take this to say things, and a compilation of debugging this sentence is not unfounded. And often take its bytecode, as if only Java has the middle, in fact, the interpretation of the language almost all have an intermediate code, which is the characteristics of the interpretation of the language, this feature in the absence of Java before. Let Java speak like it was created, and other languages imitate it.
Third, the JIT optimization technology can make Java run at a speed close to C + +, and even some scenarios will surpass
Java's performance has always been the pain of Java developers, whether it is the sun or the current Oracle, almost every version of the update will focus on the performance of a great improvement, and each time like a reassuring to comfort this its users, so that everyone has confidence in Java performance. But from the birth of Java, the ascension of so many years, how much, no matter how much increase, the client (except Andriod) with Java too little, even if it is not pure Java Eclipse Performance is also uncomfortable, the service side to be divided into applications, Nor is there any server-side program that is suitable for Java, which is usually the scenario where the performance of the language itself is not the biggest bottleneck, because some of the biggest bottlenecks may be IO or database. Why JIT can not let Java catch up with C + +, the reason is very simple, the compiler language is not only C + +, there is no language to do, JIT can? Obviously unrealistic, in fact, this is the language of the characteristics of the decision, C is to achieve performance can abandon advanced features, C + + performance is one of its most important goals, and other languages are for advanced features can sacrifice performance, from the language positioning, how to optimize it is not possible to catch up with C + +, Because optimization is not possible to violate the localization of language, this is actually the fish and bear paw can not have the problem. As long as the performance can meet the application of the situation can be used, but do not exaggerate, the more self-abased people more self-esteem, people always do not like to recognize weaknesses, but there is no need to stress that this is not a weakness, the more stressed instead of the more people doubt
Speaking of performance issues, I think. NET is relatively real, when I used. NET 1.1, the performance is very poor, a normal WinForm window, if the inside of a little more control, the runtime can see you drag and drop control order, very obvious, but now much better, Basically the eyes are not visible, are all together out, so now many Windows programs with. NET performance is also very good
Iv. GC is one of the main culprits of Java performance
I think that the reverse, it should be said that Java has corrupted the GC's reputation, because many people are aware of the GC through Java, resulting in many people's hearts, the GC has become a slow pronoun, in fact, this is a common misconception of GC, GC is actually a concept, GC has been considered by the operating system implementation, Since the operating system has not been implemented, it is implemented by the programming language, but also lead to a variety of implementations. As for the performance depends on the specific implementation and algorithm selection, this is a dynamic memory management technology, and C's malloc/free, just like the role of the GC can be more advanced, malloc/free usually to be used in accordance with certain conventions to avoid memory leaks, The main difference between GC and manual memory management is that the GC needs a certain algorithm to choose how to free up memory, which is not required manually. The other is to release the timing of the choice manual more free, usually the GC is not very free, I usually say that some languages do not allow GC controllable, in fact, the implementation of the GC is controllable, but some languages do not allow this, the problem is that the GC algorithm takes time, and the GC algorithm does not guarantee the optimal, So there is a performance problem, in fact a controllable GC for performance and development efficiency is a better choice, depending on the situation to choose whether to GC automatic management or manual control, like the D language scheme, it uses GC, but the performance is very high, and the GC is controllable, your program does not have to rely entirely on the GC algorithm, I generally call this method semi-automatic, so better, how to manage memory should be the developer's freedom, because the fully automated management of the GC will sometimes cause the application of the lag, especially when not appropriate to start GC memory management, which makes some types of programs difficult to accept, such as in the shooting game, or video decoding program, even a little bit of the stutter experience is very bad (less than 24 frames in a second), but in the web such applications, the service side program short time to pause the client almost feel, even if the time of the user will be considered a network problem or browser problems
For more information on GC, please refer to http://www.iecc.com/gclist/GC-faq.html
Five, there are many online posts through specific code testing, Java performance beyond the C + +
No matter what the code is, as long as the result is really super, that must be cheating, do not believe you can personally verify, if you really understand C/s, or you may be in the strokes, but these posts are attracting attention, attracted a lot of unknown really want to onlookers. My point is that in the case of acceptable performance, the language features can bring more benefits, which is a good choice, which is one of the reasons why PHP can be popular in web development. But some Java people always make this kind of post behavior is very despised, and I find it seems like only Java like to challenge performance, in other languages are rarely seen, this is worth thinking of Java people
Written at the end:
See this Java powder will be unhappy, Java advantages are also obvious, many libraries, very much. There is also a big advantage that Java developers do not need to have a deep understanding of the underlying technology network technology to develop heavyweight applications, and in a sense, this frees developers from the technical details and focuses more on application logic. So many heavyweight software was born, and then some people questioned why such software would be developed in Java, and then someone came out and said Java was not slow, then ... And then nothing happened. In fact, in terms of language, Java used to be good.
We always listen to a lot of lies and slowly also believe, because many times the truth is what may not be so important
Count the Java rumors that we're used to