Jump to main content

Go Is Good for Beginners

This post is more than 10 years old. It may be out of date — read and use with care.

I know, it’s a tough call. Suggesting a programming language to someone just starting out is a big responsibility. So many languages have gotchas that’ll trip up newbies and add needless frustration to their journey as a software developer. Don’t even get me started on the volumes of books about undefined behavior.

But that’s why I’m here to make a case for Go. It’s a fantastic choice for beginner programmers because it does so many things right. Let’s dive into the reasons why.

Elegant Simplicity

Most programming languages are ancient and have collected a ton of design baggage and outdated behaviors that no longer make sense. And compilers? Not much help in most cases. Trying to explain that to beginners can be a real struggle and a waste of valuable time.

Go is free of cruft. It is really well designed by just three language designers, which lead to a perfectly simple and straightforward spec such that it serves as a daily reference.

I am confident that Go will remain free of cruft in the future.

Standard Library

Yeah, okay. The Go standard library is small. With just 142 packages in go1.1.1, it might even seem tiny. But I’ll tell you what, I know about 50% of its interface by heart.

As a passionate .NET developer, I believe that simplicity is the key to efficient software development. But with 9477 public classes in .NET v4.0.30319, it’s a lot to keep track of.

Don’t even get me started on Python. They claim to have “batteries included”, but their APIs are far from perfect (urllib2, anyone?) and don’t even follow naming conventions (looking at you, unittest).

Having a useful standard library is essential for beginners. It saves them from dealing with a whole new world of namespaces and dependency management. And that’s exactly what Go provides. With simple and well-designed APIs for many common requirements, Go is ready for anything. Recently, the Go team has also focused further development on web applications, providing JSON serialization, unicode handling, a crypto package, a user-friendly HTTP server and client, and fast HTML and text templating engines.

Formatting Madness No More

Where do your curly braces go? Tabs or spaces? How many? Use redundant conditional parentheses? Debate closed. With Go, formatting debates are a thing of the past.

go fmt formats your code and that’s it. No room for interpretation. It removes redundant braces, indents your code, and adds a line feed to your sources. And the compiler is unforgiving – Go doesn’t do warnings. It either compiles or throws an error.

Most proper text editors will run go fmt when you save your files. No more manual indenting or file ending issues.

Docs

Go feels well thought and made. The docs are no exception.

  • Go Tour, an interactive introduction into the language
  • The Go blog with regular posts coming up explainig design decisions and language internals
  • The language spec
  • The well documented standard library that contains API docs and samples

Conclusion

Go is awesome. It’s great for beginners due to its simplicity and it’s equally well-suited for seniors as it does so many things well. Experienced developers will appreciate those things while beginners can focus on learning programming instead of learning the warts of individual languages. Whether you’re just starting out or have been coding for years, Go has something to offer.

Why don’t you just give Go a try?