00 Preface Go Designed for Developers' Needs Helps You Work Efficiently

00 Preface - Go Designed for Developers’ Needs Helps You Work Efficiently #

Hello, I am “Feixue Wuqing”. I have been working in the technology field for nearly 10 years and I am currently serving as the Technical Director at an Internet company, responsible for technical management and architectural design.

In 2014, I came across the Go language because of Docker. Its concise syntax, efficient development productivity, and built-in concurrency support deeply attracted me. After continuous learning and practice, I gained a deeper understanding of the Go language. Shortly after, I led the team in transitioning to Go language development, increasing our team’s development efficiency and system performance while reducing labor costs.

During the process of leading the team in transitioning to Go language, I continuously summarized my experiences in learning the Go language into articles, making it convenient for everyone to learn in their spare time. As a result, my WeChat public account and Zhihu account, both named “Feixue Wuqing,” were created. Now, I have published over 200 related articles, helping tens of thousands of friends effectively learn Go and even receiving the highest praise in Zhihu’s Go language topic.

Go language designed to meet the needs of developers #

Kubernetes (K8s), Docker, etcd, and other well-known tools are developed using Go language, and many large companies (such as Tencent, ByteDance, etc.) are migrating their previous C/C++, Python, and PHP technology stacks to Go.

In my opinion, Go is highly regarded as an efficient industrial language, which is directly related to its inherent advantages:

  • Concise syntax, easier to grasp compared to other languages, and higher development productivity.
  • Built-in garbage collection (GC), no need to manually allocate and release memory, which effectively avoids bugs and improves performance.
  • Language-level concurrency support makes it easy to develop high-performance programs.
  • Powerful standard library and abundant third-party libraries that can be used directly, improving development efficiency.
  • Can directly generate an executable file through static compilation, does not depend on other libraries at runtime, convenient deployment, and strong scalability.
  • Provides cross-platform support, making it easy to compile programs that can run directly on various system platforms.

Compared to other languages, Go has significant advantages. For example, although Java has garbage collection capabilities, it is an interpreted language and requires installation of the JVM virtual machine to run. Although C language does not require interpretation and can be directly compiled and run, it does not have garbage collection capabilities, requiring developers to manage memory allocation and release themselves, which is prone to problems. Go language combines the advantages of both.

Nowadays, microservices and cloud-native have become a trend, and Go, as a high-performance compiled language, is best suited for implementing microservices, and it is easy to generate cross-platform executable files. Compared to other programming languages, Go is easier to deploy in Docker containers and achieve flexible automatic scaling of services.

Overall, the design philosophy of Go language is to serve software engineering, which means that it is not designed to be powerful as a programming language itself, but to better facilitate developers in software development and management. Everything is considered for the sake of developers.

If you are a developer with 1 to 3 years of experience in other languages (such as Python, PHP, C/C++), learning Go will be relatively easy because many concepts in programming languages are similar. And if you are a beginner with basic computer knowledge but no development experience, learning Go early is also suitable. Mastering it will help deepen your understanding of programming languages and improve your professional competitiveness.

In my conversations with Go language learners and through the interview process, I have also identified some typical problems, which can be summarized as follows:

First, learners have fragmented knowledge that lacks systematicness and is not too in-depth, resulting in the inability to write efficient programs and difficulty in standing out in interviews. For example, in interviews, I often ask about the efficiency of string concatenation, which involves knowledge points such as the + operator, buffer concatenation, build concatenation, and concurrency safety. However, most candidates can only answer the most basic content, lacking deep thinking about the language logic.

Second, many beginners already have a foundation in other languages, making it difficult to switch language thinking patterns. Moreover, the designers of Go have made many improvements and innovations compared to other languages. As someone who has transitioned from Java to Go, I understand this situation very well. For example, when it comes to error handling, Java uses exceptions, while Go uses function return values for error handling, which can be challenging to get used to.

Third, there is a lack of open-source projects suitable for practicing. In the process of sharing knowledge about the Go programming language in the past, I have incorporated methods to address the above-mentioned issues and received good feedback. For example, some users said, “Your articles make me feel like the clouds are parting and the sun is shining!” “I finally understand how to use context through your articles!”… These positive reviews have strengthened my confidence in sharing content.

So after continuous thinking and organizing, I hope to design a more systematic and easy-to-understand column. My goal is to help you avoid detours and improve your competitiveness in the workplace faster than others through this course.

Highlights and Design Ideas of This Course #

  • Systematic Design: From basic knowledge and underlying principles to practical application, this course will not only teach you how to use the language, but also enable you to analyze problems from the logical and framework level of the language itself, and be able to work on projects. This way, when you encounter problems, you no longer have to blindly search for specific knowledge.
  • Case-based Practical Operation: I have designed many code examples that facilitate the application of knowledge points. I specifically demonstrate some scenarios that are prone to bugs from the learner’s perspective, helping you avoid pitfalls. I also incorporate many real-life scenarios, such as using the example of a gun firing before a race to demonstrate the usage of sync.Cond, helping you deepen your understanding and alleviate the boredom of language learning.
  • Close to Reality: The content I have planned is based on feedback from numerous learners. Through continuous communication, I have summarized the commonalities and differences in their problems, and incorporated targeted content into the column.

So how is this course structured?

As a beginner, regardless of whether or not you have programming experience, you need to first learn the basic syntax of Go. Then, based on this foundation, I will introduce you to the core feature of Go—concurrency, which is also one of Go’s proudest features. Its coroutine-based concurrency is lighter weight than the thread concurrency we usually use, allowing you to start hundreds or even thousands of goroutines on a standard computer at very low cost.

After mastering the basics, we will analyze the principles in depth by examining the underlying implementation. I will combine the source code with comparisons to similar concepts in other languages, helping you understand Go’s design ideas and underlying language logic.

At this point, you may still have some questions, such as how to apply the knowledge to actual work, so you will need knowledge of Go language project quality management. Lastly, I will provide two practical projects to help you quickly get started and reinforce what you have learned.

Therefore, based on this approach, I have divided this course into 5 modules:

  • Module 1: Go Language Quick Start: I have selected topics such as variables, constants, data types, functions and methods, structures, interfaces, and so on. This section is relatively concise but covers enough content for you to grasp the basic program structure of Go.
  • Module 2: Go Language Efficient Concurrency: This module mainly introduces goroutine, channel, synchronization primitives, and other knowledge points, allowing you to have a deeper understanding of Go’s support for concurrency at the language level and enabling you to design your own Go concurrent programs. There will also be a dedicated lesson on commonly used concurrency patterns that can be directly applied to better control concurrency.
  • Module 3: In-depth Understanding of Go Language: This module explains the underlying principles of Go language and introduces advanced features. For example, how does slice work at the underlying level and why is it so efficient? I specially designed this module because when I was learning programming as a beginner, I also only learned how to use the language without wanting to study the underlying principles, which led to obstacles at work and forced me to go back and fill the gaps. Later, I realized that this is a common problem among beginners. However, only by understanding the underlying principles can you write flexible programs and efficiently handle problems.
  • Module 4: Go Language Project Management: When learning a language, it’s not just about mastering its own knowledge, but also about mastering peripheral skills such as module management and performance optimization. These skills can help you collaborate with others more effectively, improve development efficiency, and write higher quality code. In this module, you can learn how to test Go language to improve code quality, how to optimize performance, and how to use third-party libraries to improve your project’s development efficiency.
  • Module 5: Go Language in Action: Go language is particularly suitable for network services and concurrency. By developing HTTP services and RPC services as practical examples, you can apply the knowledge learned from the previous four modules and quickly get started.

Author’s Message #

I have always been tirelessly telling my teammates that Go is a modern programming language, and compared to other languages, it provides a better user experience for us developers. Its purpose is to allow us to focus more on implementing our own business and improve development efficiency. At the same time, cloud-native is a trend, and Go is very suitable for deployment in such an environment. Learning it earlier will give you a competitive advantage.

In addition, I have repeatedly emphasized the importance of learning underlying principles in the previous text. Programming languages have many similarities (such as concepts, keywords, and syntax features), and learning other programming languages after mastering one becomes much simpler because you understand the language itself. So, during the process of learning Go, I hope you will think and practice more, and strive for a deep understanding that connects everything.

Now, join me on this journey to learn the Go programming language. Let’s Go!