Go tutorial: Get started with Google Go

Go is a concise, simple, safe, and fast compiled language that trades features for speed. Isn’t it time you gave it a try?

Become An Insider

Sign up now and get FREE access to hundreds of Insider articles, guides, reviews, interviews, blogs, and other premium content. Learn more.

Why would you want to use the Go language? Basically, it’s a concise, simple, safe, and fast compiled language with wonderful concurrency features, and it easily handles large projects. It’s also free open source, even though it was originally developed at Google.

According to Rob Pike, one of the designers of the language, “the goals of the Go project were to eliminate the slowness and clumsiness of software development at Google, and thereby to make the process more productive and scalable. The language was designed by and for people who write—and read and debug and maintain—large software systems.”

In accordance with those goals, Go lacks many features of some other prominent languages—and that’s actually a strength. Go is not object-oriented, it doesn’t have header files or forward declarations, it doesn’t have a type hierarchy, it doesn’t have method or operator overloading, it doesn’t have generics, it doesn’t have a virtual machine for a runtime, it doesn’t have exceptions, and it doesn’t have assertions.

On the other hand, what Go has works quite well. It can compile big programs in a few seconds. It has low-overhead coroutines (called goroutines) that can communicate efficiently through channels. It has interfaces and interface composition. In addition, Go supports first-class functions, higher-order functions, user-defined function types, function literals, closures, and multiple return values—in other words, it supports a functional programming style in a strongly typed language.

If you’re dying to request any of the missing features I mentioned above, you might want to read the discussion of language changes in the Go language FAQ: The answer is usually “No, because…” In general, the best Go programs are designed from scratch to use Go language features, rather than translated literally from other languages that use different abstractions.

To continue reading this article register now