Why You Should Go learn the language?

Finally you are here! Go Language - allows you to use to write Python code development efficiency of C language code.

Why the world needs the Internet Go Language

There are already too many programming languages ​​of the world, why is it a Go language?

Hardware limitations: Moore's Law is already invalid

Moore's Law: When the price unchanged, the number of components on an integrated circuit that can be accommodated, and about every 18 to 24 months will be doubled, the performance will also be doubled. In other words, every dollar can buy computer performance will double every 18-24 months or more.

15511542807193.jpg

As can be seen from the above chart, the last decade and single-threaded performance processor frequency remains stable. We can not be like before, like adding more transistors as a solution, because in some of the smaller-scale quantum properties began to appear (such as tunneling), and because the cost to place more transistors in the same small space is very expensive, every $ 100 the number of transistors that can be added began to decline.

Manufacturers began to improve the performance of the processor from the other side:

  1. Add more and more cores to the processor, such as four-core and eight-core CPU.
  2. Hyper-Threading Technology invented.
  3. Add more cache to processors to improve performance.

But these solutions have their own limitations. Because the cost of the reasons we can not add unlimited kernel for your computer, can not be unlimited add caching to improve performance, because the larger the cache, the lower the value of the property.

We have no way been a breakthrough in hardware, we need to improve the performance of the software or that we need high-performance software.

Go language is concurrent born

As mentioned above, hardware manufacturers are adding more and more cores to processors to improve performance. All data centers are run on these processors, more importantly, today's applications use multiple micro-services to maintain the database connection, message queues, and Maintenance Cache. Therefore, the development of software and programming language should be able to easily support concurrency, and should be able to increase the number of cores as the CPU and scalable.

However, most modern programming languages ​​(such as Java, Python, etc.) are from single-threaded environment in the 1990s. While some framework programming language to master after a multicore continue to improve the efficiency of resource use, such as the Java Netty, etc., but still requires developers to spend a lot of time and effort to get to know the operational principles of these frameworks.

Go released in 2009, when multi-core processors already on the market. Go native language has design advantages on multicore concurrency, Go language from the ground up to support concurrent native, without third-party libraries, developers programming skills and development experience.

Many companies, especially the Chinese Internet company, is about to or have already completed the process of using the Go language transformation of the old system. Go through the language system can be reconstructed using less hardware resources to achieve higher concurrency and I / O throughput performance. Fully tap the potential of the hardware equipment is also refined to meet the current market environment operations.

Go is based on concurrent language goroutine, and goroutinesimilar threads, but not threads. It can be goroutineunderstood as a kind of virtual threads. Go language runtime will be involved in scheduling goroutineand goroutinereasonably allocated to each CPU, maximizing the use of CPU performance. Open a goroutineconsumption is very small (about 2KB of memory), you can easily create millions goroutine.

goroutinespecialty:

  1. goroutineHaving increased stack segment. This means that they will use more memory only when needed.
  2. goroutineThe start-up time is faster than thread.
  3. goroutineNative support for using the channel to communicate securely.
  4. goroutineWithout using a mutex when shared data structures.

Go powerful performance

Compared with other modern high-level languages (such as Java / Python), using C, C ++ is the biggest advantage of their performance. Because the C / C ++ is a compiled language rather than interpreted language. The processor can only be understood binaries, Java and Python when running such a high-level language needs first human-readable code is translated into byte code, and then reconverted to binary processor can be understood by a dedicated interpreter. 15511649241043.jpgLike C, C ++, Go language is compiled language, it will direct human-readable code is compiled into a binary file processor can run directly, higher efficiency and better performance. 15511709770708.jpgSource: https://benchmarksgame-team.pages.debian.net/benchmarksgame/

As can be seen, Go language is closer to the Java language in performance, although not as good as after years optimized Java language on some test cases, but after all, Java language has gone through years of accumulation and optimization. Go language in future versions will be optimized to improve operating performance through continuous single-core versions.

Go language is easy to learn

The syntax is simple

Go language is easy to learn, learning curve is gentle, not like the C / C ++ language easily take two to three years of study period. Go language is called "C language Internet age." Go language style is similar to the C language. Syntax in the C language based on a substantial simplification, remove unwanted expression in parentheses, the cycle only for a representation method, traversal can be achieved various values, key value and the like.

Code style uniform

Go language provides a set of formatting tools - go fmt. Some Go language development environment or editor when you save will be formatted using the formatting tools to modify the code, thus ensuring the code is different developers to submit a unified format. (Tucao: no longer have to worry about those who do not understand the black magic ...)

Development of high efficiency

15511721724188.jpg Go development language to achieve the perfect combination of efficiency and execution efficiency, allows you to write C code (performance) like to write Python code (efficiency) the same.

Go language learning prospects

Go Wide-language currently used in the Pan has artificial intelligence, cloud computing development, container virtualization, zoomed data development, data analysis and scientific computing, the development of operation and maintenance, reptiles field development, game development.

Go language is easy to learn, naturally supports concurrent perfectly fit the current highly concurrent Internet ecosystem. Go language job demand continues to climb, the current small number of programmers Go, good treatment.

Seize the trend, to learn to be a leader rather than a follower.

Huge domestic demand potential of the Go language, currently both domestic manufacturers and emerging Internet companies are basically there will be job requirements Go language.

Below is an example application of the Go language of the company:

image-20190203135218456.png

In addition to the manufacturers listed above, many small companies or start-up companies have begun to use the Go language, and many companies the Go language as their primary development language.

Go now to start your language learning journey! Life is short, let's Go.

Reference links

Guess you like

Origin www.cnblogs.com/nickchen121/p/11517463.html