To be fair to Java.

Source: Internet
Author: User


To be fair to Java.

Some people ask me, in the existing language, what is the best recommendation? I said, "Java.

"They were very surprised:" What? Java! "So I'm going to explain now.

Java transcends all the "dynamic languages" that curse it.

Perhaps because of the rebellious mentality of the young, people do not take their own language of entry as a matter of fact. Very early in the day. Computer Science students use scheme or Pascal to get started, and most schools today use Java.

This may be why so many people hate Java and look down on people who use Java.

When it comes to Java, it feels like something that Grandpa's generation uses.

Everyone will use Java, how can it appear I am outstanding? So they said, "Java is so big. Complex. Bloated.

I prefer to explore new languages ... "

Some Python program ape, in the forum with the beginning of the learning of the people to explain python what is good. One of the reasons is: "Because Python is not java." "They like to advertise:" Look at Python is simple and clear ah. No need to write type ... " For the sake of Java's unprovoked hatred, blind denial. Cause they do not see its very important strengths. So that I lost my way. Despite the momentum of the upper hand, however the fact that python as a programming language. is completely unable to compete with Java.

On the performance. Python is dozens of times times slower than Java. Because of the lack of important facilities such as static types, Python code has bugs that are not easy to find and easydebug, so Python cannot be used to construct large-scale, complex systems. You may find that the main code of some startup companies is written by Python, however, the software of these companies. The quality is actually quite low.

In a mature company. Python is only used for writing tool-nature items, or small. Scripts that do not affect system reliability.

The lack of static types also leads to Python's inability to have very good IDE support, you can't "jump to definition" completely reliably, and you can't refactor (refactor) Python code completely reliably. Pycharm is a very big improvement for the early Python programming environment, but the theory dictates that it is not possible to perform major refactoring operations such as "Variable name change" in a completely reliable manner. Even more powerful pysonar than Pycharm, there is nothing to do about it.

Because Python's design is overly "dynamic". There is no type tag. Make a completely accurate definition lookup. became an undecidable problem.

In design, Python,ruby is actually much more complex than Java. Missing a lot of important features, the faulty "powerful features" is a lot more.

By blindly advocating the so-called "authentic object-oriented" approach. The so-called "late binding", there are too many of these languages can "overload" the semantics of the place. Whatever can be redefined, which leads to very large uncertainties and complexities in the code, a lot of bugs are hidden inside these overloaded language constructs.

So. Python and Ruby code are very easy to be abused and don't understand. Easy writing is very messy.

Very many JavaScript programs apes also blindly discriminate against Java, and in fact JavaScript is worse than Python and Ruby. Not only do they have nearly all of their drawbacks. And the lack of some necessary facilities. JavaScript's various "web frameworks" seem to have been constantly evolving, and in fact, all in the dark.

The JavaScript community is known for being naïve and ignorant. You often find some very important common sense, as the JavaScript "experts" as a great discovery. To preach at the conference. I don't see the meaning of the JavaScript community opening those meetings. As if just to find a job for Latin America relations.

Python can be used in unimportant places, Ruby is rubbish, JavaScript is rubbish in garbage. The reason is very simple, because the designers of Ruby and JavaScript are, in fact, the smattering of the People's Division.

But the world is so strange. A thoroughly spammy language, still able to claim to be "the best friend of the program ape". So as to be loved by some people ...

Java's "heir" failed to surpass it.

Some time in the near future. Many people are passionate about scala,clojure,go and other emerging languages. They think these are more modern, more advanced languages than Java. Thought they would finally replace Java.

But these fanatics are discovering, Scala. Clojure and go do not actually solve the problems they claim to solve, but instead bring their own flaws, many of which are not java. Then they realized that Java was still far from the dead ...

Go language

About Go. I've commented on it a lot. Interested people can see here. Anyway. Go is the product of the people nine arrogant madness, wonderful. I'm not going to say much about it here, just talking about Scala and Clojure.

Scala

I know people who start out with Scala, as if they were a lifesaver. I advise them not to toss it. Old and honest useful java. Didn't listen to me. The result came later. All day long cursing at Scala's faults.

But there is no way, the project on the pirate, have to continue to use. I don't like to do personal attacks, but I find that the good or bad of a language often depends on the background of its designer. Consciousness, character and motive. Very often I see people's intuition as abnormal, so that I can predict how the language will develop in the first impressions of the language designer. Here, I would like to talk about the views of the designers of Scala and Clojure.

Scala's designer Martin Odersky. has contributed to the PL field. I have published a number of academic papers (including the famous "The Call-by-need Lambda calculus"), and still the famous Niklaus Wirth disciples, I think he is more reliable. But it wasn't long before we started contacting Scala. I was surprised to find that some of the most important things, Scala, were designed incorrectly. That's why I tried to use Scala a few times and ended up with nothing.

As I looked, I noticed a surprising design error. These problems are not in Java. After such a few times. I lost faith in Odersky. Lost interest in Scala.

Looking back at the nature of Odersky's papers, I found that although the theory seemed very strong. In fact very much is in the trick (including the so-called "call-by-need lambda calculus"). Although he has a certain depth of some specific problems, but the knowledge is in fact not very wide, more one-sided vision. For the overall design of the language, grasp is not good enough. It feels like he's a character in every language. Forced to piece together, did not consider whether they can be "harmonious" coexistence, and very little consideration of "usability."

Because Odersky is a university professor, fame is outside. A lot of people wanted him to get a PhD, so he was rambling. Like to add some shady, potentially problematic "features" to Scala. Its purpose is to send paper. Mixed graduation. This leads to a plethora of features that Scala does not choose to add. Excessive complexity. The increased features were so much later proved to be of little use, but they brought problems. Students add code implementations to Scala's compilers, and graduation leaves no matter what, so the Scala compiler. Left behind a heap of historical trash and bugs. This may not be Odersky a person's fault. However, at least it means that he is not strict, or the taste is indeed problematic.

The most famous company to use Scala is Twitter. In fact, a system like Twitter can be written in Java. What happened to Twitter? The CEO ran:P the new CEO took office and laid off more than 300 people. Includes the project master.

One of the reasons I expect Twitter to lay off is. There are too many Scala program apes, pulling on a variety of tall and non-useful slogans, such as "functional Programming", for over project. Waste the company's resources.

Spend the company's money, open a variety of meetings, organize a variety of meetup and hackathon. Improve your prestige in the open source field. In fact, it doesn't create much value for the company ...

Clojure

Let's take a look at Clojure. When Clojure first "turned out", some people are boiling their blood to recommend to me. So I looked at its designer, Rich Hickey, for a lecture video.

I was very impressed with his ability to smattering his breasts. Rich Hickey really is halfway decent, not even a CS degree. But his kind of momentum, as if other language designers do not understand anything. Only he saw the truth. It's just people like that. Talent to create a "religion" it?

Full of popular nouns, what lazy ah, pure ah, STM AH. Claims to solve the "large-scale concurrency" problem. ...... This is very easy to take the bait.

In fact, he has these words. are hearsay from other languages. But did not have a deep understanding of its essence.

Some of the "functional language" of the characteristics of the original is problematic, but for the right doctrine, in order to appear tall, copied over. So finally you find this language is hanging sheep head selling dog meat, dogskin plaster as well. It's so lame to use.

Clojure's community has been busy copying ideas from scheme and racket projects. But also want to advertise is own invention. For example typed Clojure, is intact copy typed Racket. Some of the same basic concepts, in scheme, are decades old. Nen is going to change a different name before you find out that it was scheme first. Even some people put sicp,the Little schemer and other classics in the code. All are rewritten with clojure. The results completely lost the simplicity and clarity of the original. Finally, you find that the Clojure is in good place. It's all scheme already. The new features in Clojure almost all have problems. I have participated in some Clojure meetup, but I found out later. Inside is a variety of shouting big slogan of the small white, all kinds of high-tech toes of the people, ignorant.

Suppose you want to make a system now, really prefer to use Java, do not waste time to toss what Scala or Clojure. The wrong person designs the wrong language and takes it out to waste everyone's time.

Java doesn't have a particularly nasty place.

I am not so clear as to how many people hate and discriminate against Java. It may lack some handy features. However, Java has long been used in teaching, working with Java and developing Pysonar in Java. Rubysonar. Yin Language, ... I find that Java is not as hateful as it is in many people's legends.

I found that I wanted more than 95% of the functions, in Java can find a more direct use of the method. The remaining 5%. With a little bit of stupidity, the same can solve the problem.

People who blindly admire Scala and Clojure have found that the "new features" in these languages are almost always faulty. The most important and useful features are in fact already in Java. Some people say to me: "You see, Java can't do this thing!" "Later I analyzed. Found themselves in the unconscious of the rigid identification. Have to use some of the latest and coolest language features. Ability to achieve the goal. Java doesn't have these features, they think they have to use a different language. In fact. Let's say you look at the problem in a different way, instead of focusing on solving the problem, instead of chasing the latest and coolest "writing", you can solve it with Java and solve it cleanly.

A lot of people say Java is complicated and bloated. In fact, it was because of the early design Patterns that I tried to propose a stereotyped template. Creates unnecessary complexity for the program. However, the Java language itself is not equivalent to design patterns. The designers of Java, and the designers of design pattern, are completely different people. You can use Java to write very simple code without using the design Patterns.

Java is just a language. Language only gives you the main mechanism, as for the complexity or simplicity of code writing. Depends on the person. Transfer the hatred of some Java-Program ape that abused design patterns to the Java language itself. It is unwise to abandon all of it altogether.

Conclusion

I usually use Java to steal music, would not bother to comment on other languages.

But I really can't bear to see some people being fooled by Scala and Clojure, so here's a few words to say. Assuming that there is no super-high performance and resource requirements (probably in the low-level language of C), I now suggest that you use Java as an old and honest man.

Even though it's not as cool as some new languages, the actual system is really not written in Java. A few places may need to circumvent some restrictions. Or relax some of the requirements. However, this is not a very much situation.

It is important to use what tools to program, but the tools are not as important as their own technology. Very many people spend too much time, tossing all kinds of new languages, hoping that they will miraculously improve the quality of the code, the result is nothing at all. The most important condition for choosing a language should be "good enough" to be able to, because the success of the project is finally by people, not by language. Since Java doesn't have a big problem, it won't make you a good project, so why not try some new languages?



Original address: http://www.yinwang.org/blog-cn/2016/01/18/java/

To be fair to Java.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.