Reprint this article, a big part is to agree that "conservative design thinking is the greatest advantage of Java" sentence
------------------------------------------------------------------
"Editor's note" Java is an object-oriented programming language that can compose cross-platform applications, which is almost the language of entry for every programmer, and the Java Programmer's way of practicing is a popular learning book for programmers. Ben Evans, one of the authors of the book, recently attended the Shanghai Qcon Conference, where the Turing community interviewed the bull-man.
Ben Evans is co-founder of Jclarity. Its company is committed to developing performance tools and services that can help development and operations teams. He is one of the organizers of the LJC (London Java User Group) and is a member of the executive Committee of the JCP (Java Community Process) to help define some of the standards in the Java ecosystem. He is also the "Java Champion" honorary winner. He has co-authored the Java Programmer's Path of cultivation (thewell-grounded java Developer) and the Java Authoritative Technical Manual (6th edition) (Java ina nutshell). He has delivered several lectures on the Java platform, performance, concurrency, and related topics.
Ben Evans
Q: The Java authoritative technical manual (java in a nutshell) is a classic, its previous version (5th edition) up to 1200 pages, and 10 years later in China will be published in the 6th edition is only 400 pages, what is the change between the two version? What does the decade mean for Java?
Ben Evans: The 1th edition of the Java authoritative technical manual was published shortly after Java became popular, when people were full of imagination about Java. In the next five editions, the book gets bigger, and the content continues. So each of these focuses on history, because there is an evolutionary relationship between several versions. This is a result of several factors, some of which is purely because it is so good to write, you just have to know that this version and the previous version of the increase or decrease in comparison. But more importantly, earlier, in most businesses, Java has a long life cycle, so you can often see very old versions of Java. So it's important to understand the differences between different versions. So when you're working on a Java version of a company, if you know which version it is, you know what you can and can't do, and how this version changes compared to other versions.
> This is the first thing I want to change when I start to write a new version. Because now the latest version of Java 8 (which is easy to confuse, the 6th edition of the Java authoritative Technical manual is about the 8th edition of Java), the life cycle is much shorter than before. Of course, this depends on the specific area, but when you understand the general usage situation, you'll find that using older versions (like Java 6) is just a handful of people. Of course there are still some crazy people still using the previous version of 6, most of the users are using version 7. Now, version 8 is capturing the market fast, with 15% to 20% of users already using Java 8 in just half a year. So the new version of the Java Authoritative Technical handbook is more open than ever, and we're starting to focus on the world beyond Java, and we'll talk about the present and the future.
The third thing I tried was to capture the changing trends and patterns of Java. So many things about how Java was used in the past have been removed, and I've added more modern ways to use it, and readers need to understand garbage collection, memory allocation, and concurrent programming, and I've talked a lot about that. This involves a lot of work, because the original version is focused on preserving the original content. Of the One-third content left in the fifth edition, about 25%-30% were left in the sixth edition, and the content was re-edited, while the remaining 70% or so was new.
Because we wanted to get this book out when Java 8 went into use, so we started writing when Java 8 didn't come out, and then there was some work that didn't happen at first (like the hidden features on Java 8). But this time our experience is richer, so we want to be able to complete the next version in April 2016, when Java 9 comes out. In fact, I have made a concrete plan.
Q: Do you have any further plans for the Java Programmer's Way of practicing (thewell-grounded java Developer)?
Ben Evans:"Java programmer knows" this project is very good, the process of writing is also very happy. But in the process of writing the Java authoritative Technical manual, I spent a lot of energy, I think I may not write the 2nd edition of this book. I talked to the original publisher of the book, Manning, but I don't know the latest developments, so it's possible that the book will not have a 2nd edition.
Q: What is the difference between a Java Daniel and a common Java programmer?
Ben Evans: I think the programmer 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. programmers at the middle level, want to do more , they read the news on science and technology and the news on the website, they will follow 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.
Q: Although Lambda joins Java 8, 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?
Ben Evans: 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 the 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.
Q: What are some of the areas where Java and node. js are at risk of switching from Java to Node.js,java in the enterprise?
Ben Evans: There is a misunderstanding that there is no such thing as big wave companies abandoning Java to node. js. The portion of PayPal that enables node. JS is small, and most of PayPal's running code is still java. node. JS is involved in just a pilot project, which is understandable, and node. JS is an interesting environment with some interesting ideas. node. JS is very young, and it has a lot of serious problems, so it's still too early to predict the future of node. js. So while there's a lot of support for node. JS on various developer sites, there are lots of interesting items on GitHub (like writing Ardruino and playing hardware), but in all production environments, there's no doubt that Java has the most lines of code. Businesses don't abandon working software without good reason, although there are many entrepreneurs who use node. js, but entrepreneurs come fast and go fast.
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.
Ben Evans: There are two things that are not exactly right 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.
Q: Java is often compared to Scala, what is the difference between the two languages? In the future, are the two languages likely to develop in exactly the same direction?
Ben Evans: 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's too much of a feature . There is a language design guideline and is 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 for modern society has never relied solely on code, and the problem comes from a 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.
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.
Ben Evans, author of the Java Programmer's path to cultivation