"Turn" to Java to say a fair word

Source: Internet
Author: User

Some people ask me, in the existing language, what is the best recommendation? I said, "Java. "They were surprised:" What? Java! "So I'll explain it now."

Java goes beyond all the "dynamic languages" that curse it.

Perhaps because of the rebellious mentality of the young, people do not take their own introductory language as a matter of fact. Early on, computer science students used scheme or Pascal to get started, and now most schools use Java. This may be why 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 very big, complex and bloated." I prefer to explore new languages ... "

Some Python programmers, in the forum with beginners to explain what Python is good, one reason is: "Because Python is not java! "They like to advertise:" Look at Python how simple and clear ah, do not need to write type ... " The senseless hatred of Java, the blind denial, led them to lose sight of its very important merits, and lost its way. Although the momentum of the upper hand, but in fact, Python as a programming language, is completely unable to compete with Java.

In 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 easily discoverable, and it is not easy to debug, so Python cannot be used to construct large-scale, complex systems. You may find that the main code of some startup companies is written in Python, but the quality of these companies ' software is actually quite low. In a mature company, Python is used at most for writing tool-nature items, or small, scripts that do not affect system reliability.

The lack of static types has also led to Python's inability to have good IDE support, and you can't completely reliably "jump to definition" and not be able to refactor (refactor) Python code completely reliably. Pycharm is a great improvement for the early Python programming environment, but the theory dictates that it is impossible to perform basic refactoring operations such as "variable rename" completely and reliably. Even the Pysonar, which is much stronger than pycharm, can do nothing about it. Because of the excessive "dynamics" of Python's design, there is no type tag, which makes a completely accurate definition lookup a problem that cannot be judged (undecidable).

In design, Python,ruby is actually a lot more complicated than Java. Missing a lot of important features, the faulty "powerful features" is a lot more. As a result of 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 the code with great uncertainty and complexity, Many bugs are hidden inside these overloaded language constructs. As a result, Python and Ruby code can easily be abused, not easily understood, easily written, and prone to problems.

Many JavaScript programmers also blindly despise Java, which is actually worse than Python and Ruby. Not only have almost all of their shortcomings, but also lack the necessary facilities. JavaScript's various "web frameworks", endless, seems to have been in the innovation, and in fact, all in the dark and blindly hit. The JavaScript community is known for being naïve and ignorant. You often find some very basic common sense that is being preached in the General Assembly by JavaScript "experts" as great discoveries. I can't see what the meaning of the JavaScript community is to open those meetings, as if they were just looking for a job for Latin America relations.

Python can be used in unimportant places, Ruby is rubbish, JavaScript is rubbish in garbage. The reason is simple, because the designers of Ruby and JavaScript are in fact the smattering of the people's family. However, the world is so strange, a thorough rubbish language, can still claim to be "Programmer's best friend", thus obtains some people's affection ...

Java's "heir" failed to surpass it.

In recent times, many people have been keen on scala,clojure,go and other emerging languages, which they think are more modern and advanced than Java, and think they will eventually replace Java. However, these fanatics are discovering that 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 in Java. Then they realized that Java was far away from its demise ...

Go language

I've commented a lot about go, and people who are interested can look here. In short, go is the product of the people nine arrogant, wonderful. I'm not going to say much about it here, just talking about Scala and Clojure.

Scala

I know some people who start with Scala, as if they were a lifesaver. I advise them not to toss it out, to be honest with Java. Did not listen to me, the result later, all day is cursing the various problems of Scala. But there is no way, the project on the pirate, have to continue to use. I do not like to conduct personal attacks, but I find that the good or bad of a language often depends on the background, awareness, character and motivation of its designers. Many times I see people's intuition as abnormal, so that I can predict how the language will develop in the first impression of the language designer. Here, I would like to talk about the views of the designers of Scala and Clojure.

Martin Odersky, the architect of Scala, has made some achievements in the field of PL, published many academic papers (including the famous "The Call-by-need Lambda calculus"), and is also a well-known Niklaus Wirth disciple, So I thought he was more reliable. But it wasn't long before I started contacting Scala, and I was surprised to find that there were some very basic things that Scala was designed to be wrong. That's why I tried to use Scala a few times and ended up with nothing. Because I looked at it and found the surprising design mistakes that Java did not have. After such a few times, I lost faith in Odersky and lost interest in Scala.

Looking back at the nature of Odersky's essays, I found that although theoretically seemingly strong, many were in the know (including the so-called "call-by-need lambda calculus"). Although he has some specific problems have a certain depth, but the knowledge is not very broad, more one-sided vision. For the overall design of the language, grasp is not good enough. It was felt that he had put together the characteristics of various languages, and had not considered whether they could coexist in harmony and seldom considered "usability".

Because Odersky is a university professor, fame, many people want to find him to take a PhD, so rambling, like to add some shady, latent problems in Scala "characteristics", the purpose is to send paper, mixed graduation. This leads to a plethora of features that Scala does not opt out of adding too much complexity. Many of the features that were added later proved to be of little use, but they brought problems. Students add code to the Scala compiler and leave school, so the Scala compiler leaves a heap of historical trash and bugs. This may not be Odersky a person's fault, but at least it means that he is not strict, or taste is indeed a problem.

The most famous company to use Scala is Twitter. In fact, a system like Twitter is written in Java. What happened to Twitter? The CEO ran:P the new CEO took office and laid off more than 300 people, including engineers. One of the reasons I estimate the Twitter job cuts is that there are too many Scala programmers who pull up a variety of tall, impractical slogans, such as "functional programming," to get over-engineered and waste company resources. Spend the company's money, open various meetings, organize various meetup and hackathon, improve their prestige in the field of open source, actually did not create a lot of 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. But only this kind of person can create a "religion" it?

A mouthful of popular nouns, what lazy ah, pure ah, STM, is known to solve the "large-scale concurrency" problem, ... It's easy to get hooked. In fact, all these words are hearsay from other languages, but they have not been able to comprehend the essence of them profoundly. 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 that the language is hanging sheep's head selling dog meat, dogskin plaster as well as sound, and how to use it so lame.

Clojure's community, who has been busy copying ideas from scheme and racket projects, wants to flaunt his own inventions. For example typed Clojure, is intact copy typed Racket. Some of the same basic concepts, in scheme for decades, nen is to change a different name, lest you find that is scheme first. Even some people put sicp,the Little schemer and other classics in the code, all with Clojure rewrite, the result completely lost the original simple and clear. In the end, you find that all the good places in the Clojure are scheme-owned, and the new features in Clojure are almost entirely problematic. I participated in some clojure of the meetup, but later found that there are all kinds of shouting the big slogan of the small white, all kinds of high-tech toes of the people, ignorant.

If 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 still do not understand, many people to Java hatred and contempt, from where to come. It may lack some convenient features, however, it has long been teaching in Java, working with Java, developing Pysonar,rubysonar,yin language with Java, ... I find that Java is not as hateful as many people have been rumored to be. I found that I wanted more than 95% of the functions, in Java can find more direct usage. The rest of the 5%, with a slightly more stupid approach, the same can solve the problem.

People who blindly admire Scala and Clojure, many end up discovering that the "new features" of these languages are almost always faulty, and that the most important and useful features are already in Java. Some people say to me: "You see, Java can't do this thing!" Later, I analyzed, found that they have been in the unconscious of the rigid identification, have to use some of the latest and coolest language features, to achieve the goal. Java doesn't have these features, they think they have to use a different language. In fact, if you look at the problem in a different perspective, do not focus on the problem, instead of pursuing the latest and coolest "writing", you can solve it with Java, and solve it cleanly.

Many people say that Java is complicated and bloated, in fact, because of the early design Patterns, trying to propose a uniform template, to the program brought unnecessary complexity. 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 basic mechanism, as for the complexity or simplicity of code writing, depending on the person. It would be unwise to transfer the hatred of Java programmers, who misuse design patterns, to the Java language itself, thus completely discarding it.

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. If there are no super-high performance and resource requirements (probably in a low-level language like C), I would recommend using Java for now. Although not as cool as some new languages, but the actual system, there really is no Java write out. A few places may need to circumvent some restrictions, or to loosen some requirements, but this is not a lot.

It is important to use what tools to program, but the tools are not as important as their own technology. Many people spend too much time, tossing all kinds of new languages, hoping that they will miraculously improve the quality of the code, and the result is nothing at all. The most important condition for choosing a language should be "good enough", because the success of the project is ultimately 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?

"Go" to Java for a fair sentence

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.