The biggest advantage of Java is the conservative design idea

Source: Internet
Author: User
Tags virtual environment ruby on rails

What is the difference between a Java Daniel and a common Java programmer?

I think the programmer's hierarchy can be viewed as a pyramid, which can be roughly divided into 3 levels. At the bottom are very hard-working programmers, but they may not be interested in programming itself, they can do a good job, but they will not think about programming after work. This is a normal phenomenon, the software industry needs a lot of programmers, and the demand is still growing. The programmer at the middle level wants to do more, they read the news on science and technology and the news on the website, they will follow up the next version of the progress, they care about their skills, this level of programmer is very interesting. The top programmers are always fascinated by the nature of craftsmanship and technology. When you reach the top of the pyramid, you will begin to have feedback loops that you can learn from yourself and have a deeper understanding of your skills. But I think the hardest part is how to break from the second level to the top level. If you have a little bit of interest in what you do outside of your job, you have to look for your own point, which is different for everyone, and once you find the area that fascinates you, you can go deeper with curiosity.

About open source software There is a saying, a good open source developer must find their own pain point, they have to solve the problem that bothers them. That's why most people are interested in open source software, and that's what many call Java developers. You have found a point that interests you, because of the unknown so, you have been learning, this is the secret of growth.

There is always a lengthy complaint about Java syntax between developers. Do you think this is the main reason why many developers and teams are reluctant to use Java?

I don't think so. James Gosling has three words to explain the language design of Java and why Java is the way it is. The first sentence is called "Blue-collar" language in English, blue-collar workers are engaged in front-line work, while white-collar workers represent the office and managers work. Java is a blue-collar language designed to allow working programmers to solve real problems. Java is a practical language that solves real-world business.

James Gosling, speaking at the 2014 JavaOne conference about lambda and some of the designs that didn't appear in earlier versions of Java, said: "If I don't find the right way to do something, I don't do anything." This statement expresses a slow and conservative evolutionary design idea, which must be understood in order to understand what Java is. Many people think Java is old, programming languages need to change, but what they don't know is that what really changes is themselves. They develop in their abilities, they want to see farther and deeper, and language reflects this. It is not the language that needs to change, but the programmer who has made that point. Java from the past to the future is a design conservative language. This is also a big advantage of Java.

When James explained his intention to design Java, he said: "When I was designing, I knew people wanted automatic memory management, and people wanted to be strong, but these features would scare blue-collar workers away." For example Smalltalk, this is a very good language, but it is too advanced, it and the real developers in the construction of the application of the thinking of the separation. So Java inherits some of these ideas and simplifies them by putting them into a language and format. These things explain the basic motives of the language design.

So of course you can say that Java is a lengthy language, but I think the extra content is for easy reading. Especially when you are a beginner or intermediate programmer, those seemingly superfluous words can help you. People always remember that our demand for productivity is getting higher, but the code is still written. So I don't think Java is lengthy, although we can add some advanced features, but some things will never change in one language, which is regrettable. Of course we will progress, but as I have always said, people tend to care too much about grammar, not what they can achieve with words.

As one of the most interesting products in recent years, Twitter, if you look at their development you'll find that they're starting with Ruby on Rails. Three or four years ago, their website began to appear with a very cute cartoon image of the failed whale. It was a very embarrassing thing to figure out what was going on, they did a lot of research, and after looking at Ruby's garbage collection, they found they could do nothing. At the same time, their Java pilot project was successful and they realized that Java could solve their extensibility problems. Then over the next 18 months, they used some jruby as a transit point and then rewritten the entire system into Java. The end result is also very good, they introduced a new service, new architecture around Java. Once upon a while, Ruby was seen as the future of enterprise software, but today, Ruby is just one of many programming languages. The three most widely used languages are java,javascript, and C + +, but most of the JavaScript code is on the client side, and if you remove the three languages, the market share of the other languages is very small.

Until now, the virtual hosting model for Java applications needs to be assigned to the entire x86 virtual machine to host a separate JVM instance, with a separate Java application hosted on the instance. Such a method is inefficient, but Java does not natively support multi-tenant virtual and cloud computing configurations. Fortunately, there are a number of multi-tenant Java solutions that can be found in the community to solve cloud computing problems, and which one do you think is mature enough to be applied to production environments?

There are two things involved, and it's not entirely true to mix virtual and cloud with multi-tenancy. For example, in Qcon Shanghai There is a lot of sharing about Docker (Docker is a platform that does not depend on virtualization), and one of the wonderful shares from Chris Swan. He shows that the benefits of moving CPU memory from a virtual environment to a docker-based environment are still not perfect, but it has added an extra advantage to Java, as long as you run Java on Docker and you can feel it. We should comb the relationship between cloud and virtual. In addition, there are many other things you can do, such as you can build multiple JVM hosts.

But the question is really asking about multi-tenancy. On this issue, there is a product in my mind is a well-deserved champion, that is Waratek. Waratek can separate a separate non-hotspot JVM and run the host JVM in it, running Java Virtual multi-tenant JVC in the JVM, and JVC can be very lightweight. I think Waratek is a very mature and ready-to-use product, and Deutsche Bank has just announced that it has moved its first working JVM to Waratek, and since Deutsche Bank has approved the product, it should also be worth your time to study.

Java What is the difference between the design goals of the two languages that are often compared to Scala? In the future, are the two languages likely to develop in exactly the same direction?

Java and Scala are very different languages. Before we talked about Java's design philosophy, we can now talk about Scala's design ideas and how they differ from one another. Scala was originally a language from academia, the first language that Martin Odersky created was called Pizza, when Java was still version 4, and this time pizza began to incorporate some Java paradigm-like features, Java 5 also added some pizza functions as paradigms.

Martin is a very smart person and Scala has a lot of great designs. But at the same time, the language has its own problems. Sometimes it is called the "kitchen sink" language, which shows that people love and hate the language. The metaphor means that there are a variety of things in the sink that are too numerous. This is really a problem with Scala, it has too many functions. There is a language design guideline, but also an important principle in the Java design process-Conservative. Specifically, when you add a new feature ("Java Programmer's Path to practice" on page 14 for a specific example), you may also create new problems. If your language has 200 features, and this time you want to add one, I need to test it and all the other features of the interactive situation. For Scala, it's always adding new features frequently. It is difficult to know the interaction between these features. Even if Scala has a flexible, embrace-changing community, the changes in language characteristics are not easy to do. So you'll find that while Scala has a lot of good performance, you need to decide which features you want and which ones you can't touch. This is not a problem when you are programming in a team. The real problem is that the software stack of modern society is never just dependent on the code, and the problem comes from the library of functions. There are some Scala features that affect not only the target object but also other things. The more features Scala has, the more likely it is that these problems overlap with each other.

In addition, they have been obsessed with binary compatibility issues. Java, Sun, and Oracle have always thought this is the most important design concept for Java, so I can write programs in Java 1.0, compile them, put them in a Java 8 virtual machine, still run, and run much faster than before. Scala has never made this commitment, even in the last version. In the library space, the problem is even more serious, and I know that many projects have given up Scala because the entire system crashes every time the library is upgraded.

So the two languages have very different design ideas. People always like the new things, the first early adopters will also be the first to enjoy a lot of benefits, but in more cases, people are more willing to do a second try people. You can observe the mistakes of the first person and learn from them. And Java is such a language to learn from the mistakes of others. I just mentioned the programmer's pyramid, and I don't think Scala works for the bottom, it's more about stimulating thinking for the top-level programmers. Java is a language for the entire pyramid, and it is especially useful for the bottom and middle-level programmers. I believe there will be a strong and healthy Scala community in the coming years, and I hope to exchange ideas with them. But I don't think Scala will grow into a popular language from a small audience. There may be hundreds of Scala programmers on Earth now, but this number is 1% of the Java programmer at best, and this percentage is probably not going to grow.

Free Brother even php original video tutorial CD-ROM, more information on the website customer service: http://www.lampbrother.net

The biggest advantage of Java is the conservative design idea

Related Article

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.