Why the Go Language?
Introduction
A programming language serves as a tool for product creation. The proficiency of a developer is not merely determined by the specific language utilized. However, the selection and handling of a language can directly influence a developer's mindset and trajectory of growth. In particular, comparing the currently used language with other languages significantly broadens one's technical perspective and cultivates an understanding of fundamental principles. This article aims to discuss, across five dimensions, why I chose Go and how it contributes to a developer's growth.
1. Go is a language that balances performance and productivity.
Numerous programming languages exist, each possessing advantages and disadvantages based on its characteristics.
- C offers excellent performance and low-level control, but it requires manual memory management by the developer and lacks high-level functionalities, resulting in low productivity and difficult maintenance.
- C++ and Rust support various advanced features such as object-orientation, templates, and metaprogramming, but their syntax is complex, their learning curve is steep, and their slow compilation speed makes them unsuitable for repetitive deployments.
- Java and C# are widely used for large-scale services due to their platform independence and stability, but they run on heavy virtual machines, leading to complex deployment and execution environments and high resource requirements.
- Python and Javascript are suitable for rapid development due to their concise syntax and rich ecosystem, but their execution performance is low, and the reliability of their ecosystem is poor, revealing structural limitations in large-scale systems.
In contrast, Golang is a language that achieves an excellent balance between performance and productivity. As a compiled language similar to C, Go ensures high execution performance while offering deployment flexibility comparable to interpreters due to its fast compilation speed. In essence, Go is a well-balanced language that can be reliably utilized in most environments without significant drawbacks.
2. Go prevents cargo cult programming.
During World War II, the Allied forces constructed air bases on Pacific islands to aid the war effort. The extensive provision of supplies and military equipment profoundly altered the lives of soldiers and indigenous peoples. Residents witnessed, for the first time, planes carrying manufactured clothing, canned food, and other goods. After the war, the bases were abandoned, and cargo ceased to arrive. Consequently, the islanders, imitating the soldiers, dressed as air traffic controllers, soldiers, or sailors, created makeshift runways, and used sticks to signal aircraft for landing. They continued to march in an effort to have cargo parachuted from planes. However, the planes they awaited never arrived.
Cargo cult programming refers to a development habit where one mimics the superficial aspects of code or technology without comprehending its underlying principles. Among modern developers, particularly in web development, this habit of uncomprehending imitation is common. While frameworks such as React, Next, Spring, and Django have enabled development without knowledge of internal structures, they often lead to an inability to properly address even minor errors. With the recent advent of AI code generation tools, a development approach centered on copying and pasting results rather than directly writing or understanding code has become even more prevalent.
Go fundamentally discourages such issues at the level of its language philosophy. Go is designed to be standard library-centric rather than framework-centric. Developers can construct production-level web servers using only basic libraries such as net/http and database/sql, thereby naturally cultivating intuition and understanding of low-level structures like networking, databases, and I/O. This structure, which allows for a solid grasp of fundamentals without reliance on frameworks, provides a foundation for developers to continuously grow without losing sight of the essence of technology.
3. Go offers a robust concurrency model.
Modern CPUs are evolving towards enhancing performance by utilizing multiple cores in parallel rather than by increasing the speed of a single core. Consequently, concurrency, which enables a single program to handle multiple tasks simultaneously, has become essential, and the importance of languages capable of efficiently designing and implementing it is steadily growing. Go is a language optimized for this environment. Goroutines are lightweight threads provided by Go, creatable with just a few kilobytes of stack space, and they consume minimal system resources even when thousands are executed concurrently. The Go runtime efficiently distributes numerous goroutines across OS threads via its M:N scheduler, and this process is automatically optimized without direct developer intervention. This allows developers to design concurrent logic in a safe and consistent manner, without complex synchronization logic or custom scheduling.
Furthermore, Go actively supports modern concurrency design utilizing synchronization tools such as mutex and waitGroup, as well as channel and context. Thanks to this structure, developers can naturally acquire a practical sense of concurrency and parallelism without being constrained by complex theories, and they can achieve a high level of abstraction and design capability applicable from scratch.
4. Go is a language conceived by exceptional developers who maintained a clear vision.
Go is a language spearheaded by Google and legendary developers Robert Griesemer, Rob Pike, and Ken Thompson. Notably, these individuals are the creators of Unix and the C language, and maestros in the fields of compilers and system software, which in itself attests to Go's technical credibility. With the incorporation of practical experience and large-scale service operation expertise from numerous Google engineers, Go has, from its inception, aimed at solving real-world problems and has evolved with a consistent philosophy and direction.
Other languages often cause confusion for communities and users due to compatibility breaks, design changes, unstable licenses, or non-standardized ecosystems. For example, Python's ecosystem was bifurcated for years due to the compatibility break between versions 2 and 3, and Java has seen an increase in companies hesitant to adopt it due to unstable licensing policies following Oracle's acquisition. Furthermore, Node.js still struggles to provide a consistent module system, with CJS and ESM coexisting.
In contrast, Go is a language that prioritizes consistency and stability. The Go team meticulously maintains backward compatibility, and even when introducing new features, they adhere to a gradual integration approach to avoid conflicts with existing code. The syntax also avoids unnecessary keywords and limits excessive abstraction, preventing the language itself from becoming unduly complex. Moreover, consistent official toolchains such as go fmt, go mod, go build, and go test guide all Go projects to have the same development environment and structure, and the powerful and practical standard library faithfully supports most functionalities required for practical development, such as web servers, file processing, and database integration, without the need for separate frameworks.