Maybe you have heard about Go. Maybe you haven’t. Depending on who shared their experiences with you, the impression you got is either good or bad. I’ll give you the 6 main reasons I see that you should start writing code in Go right now.
1. Go is a Compiled Language
It might not mean a lot to you – but most of the developers out there today have been writing code in nothing but dynamically typed scripting languages all their lives. This is all fine and dandy – but the metal that actually run the code, needs some machine language and it certainly need strong types. If you have been writing code in scripting languages or for running on VMs your entire career, I urge you to try a real compiled language – it feels very good. No more carrying around an interpreter, virtual machine or heavy standard library. With Go, you can compile a binary and run it – one file.
2. Concurrency in Go is really easy
And I mean like SUPER easy. Go use goroutines for concurrency – it is dead simple – you put “go “ in front of your function call and boom – concurrent execution. Built in channel type makes it oh so very easy to communicate between concurrent parts of your code. Look it up for further details – it is so nice.
3. Writing Servers is Easy
The Go standard library contain very powerful mechanisms for writing HTTP servers. If you know stuff like node.js and appreciate how easy it is to write a small server that does amazing stuff, you will love Go. Even writing small mock servers is easy and convenient.
4. The Code is Beautiful
Well – it really depends on what you personally prefer – but since I first saw some Go code, I really liked the structure and simplicity the language offers. Things like multiple return values makes a nice icing on the cake – but one of the very best features is gofmt. It will format your code THE standard way – no more team arguing where to place the brackets and stuff like that. Just beauty in the code.
5. Fantastic Standard Library
Check it out yourself. And check out the “community” packages too. It is simply fantastic!
6. Workspace Structure
The standard workspace structure will work in your favour if you follow it. All the builtin tools like “go get”, “go build”, “go test” and “go install” will function so very nicely.