Why choose to use the Go language

Source: Internet
Author: User
This is a creation in Article, where the information may have evolved or changed.

Why choose to use the Go language

Many cloud startups in China will choose go as their primary language, such as Daocloud. Why did you choose go? What are the advantages of the application compared to other languages?

  1. Learning curve

It contains class C syntax, GC built-in, and engineering tools. This is important because the go language is easy to learn, so it takes one weeks for an average college student to write up a ready-to-use, high-performance application. Everyone in the country is pursuing fast, which is one of the reasons why domestic go is popular.

  2. Efficiency

Go has close to C's running efficiency and close to PHP development efficiency, which is very advantageous to support the above all the pursuit of rapid demand.

  3, the birth of a noble, pure blood

The reason we say go is because we know that the go language is from Google, the company's reputation and strength in the industry is naturally not much to say. Google gathered a group of cattle, in a variety of programming languages dominate the situation to launch a new programming language, naturally have its strategic considerations. And from the development of the go language, Google for its new favorite is still very important, go naturally has a good development prospects. Let's look at the main creator of the Go language, which is a clue to the pure pedigree.

  4. Free and efficient: combination of ideas, non-intrusive interface

The go language can be said to be the perfect combination of development efficiency and operational efficiency, and innate concurrent programming support. The go language supports all current programming paradigms, including procedural programming, object-oriented programming, and functional programming. Programmers can picking, free to mix, and want to play how to play.

  5, the powerful standard library

This includes Internet applications, system programming, and network programming. Go inside the standard library is basically very stable, especially the three I mentioned here, the network layer, the system layer of the library is very practical.

  6. Easy to deploy: binary files, copy deployment

I believe this is the biggest reason many people choose go because it's so easy to deploy, so there are a lot of people now using go to develop operations programs.

  7. Simple concurrency

It contains a reduction in mental concurrency and easy data synchronization, which I think is the biggest feature of go. It's so hard to write the right concurrency, fault tolerant, and extensible programs because we use the wrong tools and the wrong abstraction, and go can say that this piece is pretty simple.

  8. Stability

Go has strong compiler checks, strict coding specifications and complete software lifecycle tools, with strong stability and overwhelming stability. So why is go more stable than other programs? This is because go provides tools for every aspect of the software lifecycle (development, testing, deployment, maintenance, and so on), such as Go tool, GOFMT, go test.

Here refers to a classmate to go to comment on the words: the first to prepare on-line when actually in the mind quite disturbed, after all, once the fault, not only the bag to his back, face also on the wrong AH. Fortunately the result is pretty, since the launch did not appear a sudden bug, reduce the difficulty of operation and reduce the load of the machine. I believe this is what most people use to go after the speech.

  So what are some of the drawbacks of go now? Here are some of the problems I have encountered in project development:

1.Go Import Package does not support version, and sometimes the upgrade is easy to cause the project is not operational, so you need to control the corresponding version information. The good behavior is that from Go 1.5, go has paid attention to this and supports vendor.

2.Go Goroutine once started, the different goroutine switch is not controlled by the control, runtime scheduling needs rigorous logic, otherwise goroutine sleep, over a period of time logic ended suddenly came out and executed, which will lead to logic error and so on. This current no solution, should belong to the Scheduler optimization.

3.GC delay a bit large, I developed a log system hurt once, at the same time, in the case of large concurrency, processing a large log, the GC is not so fast, memory recovery is not a force, and later through the profile program improved after the improvement. For now, the GC has been optimized very well. Go1.4 upgrade to Go1.5 after the effect, from 300ms to about 50ms.

Go1.5 upgrade to Go1.6, from 40ms to about 2ms, it can be said that the current GC is basically not the problem of go.

  4.pkg the following picture processing library Many bugs, or using mature products good, call these mature library ImageMagick interface more reliable. All in all, from an engineering standpoint, choosing Golang is a very smart choice for most background applications. This makes it easy to take into account the operational performance, development efficiency and maintenance difficulties of the three great many programs ape desire to die of the point.


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.