Start learning Go

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

In fact, the focus on go for a long time, the last to participate in the activities of Gopher China also has a period, each weekend will also take time to see go grammar, has been busy learning the development of Android, recently also finally have time to learn go.

  1. Simple deployment. Go compilation generates a static executable file with no external dependencies other than glibc. This makes deployment incredibly convenient: only a basic system and the necessary management and monitoring tools are needed on the target machine, so it is not necessary to worry about the dependencies of the various packages and libraries required by the application, which greatly reduces the burden of maintenance. This is a huge difference from Python. For historical reasons, Python's deployment tools are ecologically quite chaotic "such as Setuptools, Distutils, Pip, Buildout's different applications and compatibility issues." The official PyPI source is often problematic and requires a private image, while maintaining the image takes a lot of time and effort.
  2. Concurrency is good. Goroutine and channel make it easy to write high-concurrency server-side software, and in many cases there is no need to consider locking mechanisms and the various problems that arise. A single Go application can also effectively utilize multiple CPU cores and perform well in parallel. This is also the Tianrang of Python. Multi-threaded and multi-process server-side programs are not easy to write, and because of the global lock GIL, multi-threaded Python program is not efficient use of multicore, can only be deployed in a multi-process way, if the multiprocessing package in the standard library will be a lot of monitoring and management challenges " We use the Supervisor management process, the fork support is not good ". When you deploy a python application, you typically deploy an application for each CPU core, which can cause a lot of wasted resources, such as assuming that a Python application takes up 100MB of memory while the server has 32 CPU cores, leaving a kernel to the system and running 31 copies of the application will waste 3 GB of memory resources.
  3. Good language design. From the academic point of view the go language is very mediocre, does not support many advanced language features, but from the engineering point of view, go design is very good: The specification is simple enough and flexible, the other language based programmers can quickly get started. More importantly, Go comes with a complete tool chain, which greatly improves the consistency of team collaboration. For example, GOFMT Auto-typesetting Go code, to a large extent, to eliminate the different people write code layout style inconsistent. The editor is configured to automatically run GOFMT when editing the archive, so that you can place the position when you write the code, and automatically turn it into the correct code when you archive it. There are also very useful tools such as Gofix, Govet and so on.
  4. Good execution performance. It's not as good as C and Java, but it's usually a bit higher than the native Python app, and it's suitable for writing some bottleneck business. The memory footprint is also very provincial.

So go is a very good language, in fact, language is just a tool, program = algorithm + data structure + language. So it's also a recent study of MySQL. The database has always been my Achilles heel. Things like algorithms and data structures have to be stepped up, because that's the basic accomplishment of being a good programmer.

Start learning Go
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.