Let's Go: Learn Go in 30 days

Do you want to learn a new programming language but don’t know what language to choose? Have you heard about Go? Well, let’s learn Go in 30 days!

From its official page, Go is “an open source programming language that makes it easy to build simple, reliable, and efficient software”.

Go is a popular language. According to Stack Overflow 2020 Developer Survey, Go is in the top 5 of most loved languages. It ranks in the top 3 most wanted languages. Docker, Kubernetes, and a growing list of projects use Go.

Why to choose Go?

Go reduces the complexity of writing concurrent software. Go uses the concept of channels and goroutines. These two constructs allow us to have a “queue” and “two threads” to write to and read from it, out-of-the-box.

In other languages, we would need error-prone code to achieve similar results. Threads, locks, semaphores, etc, …

Rob Pike, one of the creators of Go, explains channels and goroutines in his talk Concurrency is not parallelism.

How to learn Go? Methodology

To learn a new programming language, library or framework, stop passively reading tutorials and copy-pasting code you find online. Follow these two principles:

Learn something by doing. This is one of the takeaways from the book Pragmatic Thinking and Learning. Instead of watching videos or skimming books, recreate examples and build mini-projects.

Don’t Copy and Paste. Instead of copy-pasting, read the sample code, “cover” it and reproduce it without looking at it. If you get stuck, search online instead of going back to the sample. For exercises, read the instructions and try to solve them by yourself. Then, check your solution.

“Instead of dissecting a frog, build one”.

― Andy Hunt, Pragmatic Thinking and Learning

Resources

Before starting to build something with Go, we can have a general overview of the language with the Pluralsight course Go Big Picture.

To grasp the main concepts, we can follow Learn Go with tests. It teaches Go using the concept of Test-Driven Development (TDD). Red, green, and refactor.

Other helpful resources to are Go by Example and Go documentation.

“To me, legacy code is simply code without tests.”

― Michael C. Feathers, Working Effectively with Legacy Code

Basic

Intermediate

Advanced

Fullstack

You can find more project ideas here: 40 project ideas for software engineers, What to code, Build your own x and Project-based learning.

Conferences

Conclusion

Go was designed to reduce the clutter and complexity of other languages. Go syntax is like C. Go is like C on asteroids. Goodbye, C pointers! Go doesn’t include common features in other languages like inheritance or exceptions. Yes, Go doesn’t have exceptions.

However, Go is batteries-included. You have a testing and benchmarking library, a formatter, and a race-condition detector. Coming from C#, you can still miss assertions like the ones from NUnit or XUnit.

Aren’t you curious about a language without exceptions? Happy Go time!

You can find my own 30-day journey following the resources from this post in LetsGo

canro91/LetsGo - GitHub