Let's learn Go!


Go is a programming language created by a team of very talented folks at Google with the help of many people from the Open Source community. Its source code is open source itself and can be viewed and modified freely.

This book will try to teach you how to write some code in Go, while having fun doing so. It comes with many illustrative examples and diagrams in order to make the studied concepts easy to understand.

Why Go?

There are gazillions (not that many actually) of programming languages already in the wild. So one could, and rightly so, ask why yet another language? The fact is Go is easy to grok, and fun to use but also efficient and well designed.

Go is a compiled language, i.e. a language that produces machine code that can be executed without the need of an external interpreter like Python, Ruby, Perl and other scripting languages.

In fact, if we were to compare Go to something, it would be a modern C. Yes, that’s a strong statement that calls for a justification. Being a C programmer myself, C has its very own dear place in my heart, a place that won’t be shared by anything else. But Go earned my respect and that of many others thanks to its simplicity, efficiency and smart concepts that this book aims to demonstrate.

Go comes with some new syntax and idioms but not too many. Enough to make things evolve, but not too many to alienate people who are used to some other programming language. This balance, and -I’d dare to say- minimalism are what makes Go fun to learn.

Go has the efficiency of statically-typed languages, yet it provides some easy syntax and concepts that make it as cool as dynamic languages.

Go programs are compiled fast and run fast. Go also natively supports concurrency and communication.

Why this book?

This modest work is an introduction to the Go language. It is meant to be easy to understand by everyone and tries to make this learning experience fun and easy. Yes, that’s quite a challenge, but... aude aliquid dignum! [1].

I personally don’t buy the “learn the hard way” method. Learning shouldn’t be hard! Just remember that we’ve learnt how to speak while playing when we were younger and stupider. And Go, or any other language for that matter, is actually a lot easier than any spoken language; there are fewer words, fewer syntax rules, fewer idioms...

So here’s the deal and the only condition for learning with this book: take it easy. Really, consider it as a game.

We will play with data and code, learn something new every time. There will be some diversity, from simple, or even silly things, to some very serious and smart concepts.

Also, almost -if not all- the provided programs can be tested online in the Go Playground simply by copying/pasting them there.

A work in progress

This is a personal initiative, I have no deadlines with any publisher. I do this for fun, and during my free time. I will strive to improve it as much as I can. I don’t claim to be perfect —no one is!

So your help, criticism, suggestions are more than welcome. And the more you contribute, the better it will be.

Thanks for your attention, and have fun!

[1]16th century Latin for “Dare something worthy”