In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/03 Report--
Is it necessary for Java to convert to Go? In view of this problem, this article introduces the corresponding analysis and answers in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible way.
Depending on the situation, you can see whether it is necessary to switch to Go language. If you are interested in Go language, and conditions permit, it is recommended to switch to Go language. Go language is a statically strongly typed, compiled language. Not only the syntax is simpler than Java, but also the performance is better than Java, and the compilation speed is faster.
Go
In terms of concurrency, goroutine and channel mechanisms provide lightweight and undragged concurrency mechanisms at the language level; in terms of performance, they provide performance no weaker than Java (performance is a pseudo-proposition), while memory resource consumption has obvious advantages over Java and other dynamic languages. In terms of syntax, it has some of the dynamic language features of Python, and provides extremely concise expression in the aspects of object initialization, construction and serialization, while these processing codes may account for 10% to 50% of the code, especially in dealing with data, configuration and protocol mapping scenarios. Compared with C, C++ and Java, this is the key to why dynamic languages are fascinating.
This is the key to why the first version of the Go language was so eye-catching when it was released, especially for dynamic languages, which provide concurrency and performance advantages that dynamic languages do not have. Pike designed the Go language to be an alternative role for Go + (note that it is not a replacement, its design goal is not to replace). Pike, the chief software engineer at Google, the father of the Go language, was frustrated with this goal in his 2012 "Avenue to Jane" speech, quoting: "Although we expected C++ programmers to see Go as an alternative, instead most Go programmers come from languages like Python and Ruby." Very few come from Clippers. " The essence of the value of C++ lies in: language provides a wide range of abstract, elegant and flexible features, and these expression capabilities are zero cost of hardware, while C language from the beginning to zero hardware cost as its design purpose, but the language expressive force is C++ to solve, the direction of Go thinking is obviously not zero cost, at least not zero CPU cost, Go's idea is to minimize the workload of programmers.
One is the ultimate pursuit of zero cost of hardware, the other is to minimize the workload of programmers, no one can replace the most valuable part, Go can not meet two goals at the same time, it chooses dynamic syntax and gc, it is doomed to choose development efficiency, will sacrifice hardware efficiency for development efficiency, so it goes to the other direction, that is, the application direction that Java is good at, especially in the current network and HTPP applications. This requires good standard library and ecosystem support, while in the standard library, Go has provided lighter and excellent code libraries such as dealing with tcp/http/xml/json/ encryption and decryption, and high concurrency support for http, the core protocol of the network, has provided it with a stepping stone to pry Java.
However, we have to face its current shortcomings, it is far from mature in terms of its important language features and rigor, and there are many faults or temporary solutions, which will also affect its ecological maturity. These problems still need to be solved in the new version. The Go language officially released its first version on March 28, 2012. so far, version 1.7 has been released, and two major versions have been released almost a year, with several beta and RC versions released in the middle, which basically shows that the Go language is not fully ready.
Summary
Go has proved to be an ideal candidate for Python and Ruby in terms of dynamic language performance; in application development, especially in HTTP-related applications, it is already a challenger in front of Java, and provides another role in addition to Java where the control of resources is not so strong.
In terms of productivity, its language features and ecosystem are not yet mature, and the version is still in rapid iteration, which does not have an advantage over dynamic languages and Java. The current stage is the optional role of these languages in some scenarios. In the long run, with the full support of Google, new features and library application capabilities will continue to be added, and it is a thriving programming language, but at this stage, it is suggested that we must control the scale and complexity of the program, language and ecology have not yet provided sound support, and we must also pay attention to the risks brought by its immaturity and rapid iteration of its version.
Java
Java's success is due to the strong support of SUN, IBM, Oracle and other large companies dominated by Unix systems 10 years ago, which enabled it to gain a foothold in enterprise applications and WEB applications. In the following 10 years, the first half of the year relied on the revolution brought about by x86+Linux to maintain its share, while the success of android brought it to the top again after it stumbled to a halt. Over the past two decades, Java has accumulated the most powerful ecosystem, you can say it is all-inclusive, there is no doubt that Java has already been the huge body of an aircraft carrier, which is enough to prove its status and success. However, the complexity of its language, library, framework and ecosystem poses huge obstacles for technicians to build, such as concurrency, the synchronized mechanism of the language, the notify of the standard library to concurrent, and you can also obtain the union of HTTP through the Apache+tomcat container. Based on JVM technology, Java has good interoperability with other languages, such as concurrency Scala. You can choose its Actor or Akka written in Scala. Of course, the industry chooses more mashup scenarios such as nginx, too many …
This is the world of Java, there is never too much, there is no need to repeat horses and carriages, this is the key to the success of Java, history precipitated, let Java provide too many options, in depth, we know that the cost of learning Java is higher than C++, higher requirements for programmers than C++, unless left behind, still using the Java technology of 7 or even 10 years ago, technicians have to organize the framework and design very carefully Otherwise, the result of all kinds of reuse is to pile up an extremely bloated program, whose runtime consumption of resources sometimes scares you, which is the key to the widespread criticism of too many Java-based platforms. Reuse is a double-edged sword that needs to be tailored rather than a pot, and the scale is undoubtedly the most demanding for developers, unless languages and standard libraries provide the best and most direct options.
The answer to the question about whether it is necessary for Java to switch to Go language is shared here. I hope the above content can be of some help to you. If you still have a lot of doubts to be solved, you can follow the industry information channel to learn more about it.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.