A Tour of Go: The Server Language of the Future

Manish Rath
GDSC KIIT
Published in
3 min readAug 14, 2019

7 years ago, Go got to be open-sourced for the first time ever. Before that, it was an internal project at Google. So if you are new to Go, you have heard of it, you know a little about it, you know it is the cool language, then this blog is for you. The seed idea for starting Go was to make a tool that will not have any of the fancy stuff and just go down to the bare minimum to do the job.

So if you also think, to write powerful software you also need a powerful language, then you’re wrong. Go allows you to focus on the problem more and less on the way you are trying to solve it. Go is simple to read, and that’s the whole point of it, isn’t it?

Explosion into Popularity

There are a few names you must know before getting into Go, just like we all know who wrote Harry Potter and who directed Interstellar. Robert Griesemer, Ian, Brad, Gent are a few of the awesome programmers who have molded the language as we know of it today. A lot of the cloud is written in Go, Kubernetes for example.

Source: Google Cloud Platform

With C++, there isn’t an effortless way to do things. There’s memory allocation, deallocation, pointers and much more. On the memory side of things, Go is somewhat similar to C++. And the best thing being, it is really really fast. Go is about 40 times faster than Python, yet really simple too.

Some of the greatest minds in computer science have been behind this and they build it in a way it was easy, simple, reliable and more. In other words, they wanted to eliminate the problems that companies like Google run into when they deal with petabytes of data.

Pros

  • Concurrent, Go Routines and Channels which are its own primitives just like string or integer for other languages
  • Cross-platform, it currently runs on Windows, Linux, macOS and more
  • Avoids OOP, no fancy classes or type inheritance to suit multicore processing and parallelism
  • Garbage Collection, a pretty big transition for pro-coders
Source: Hacker Noon

Get down to Nuts and Bolts

Hello World is basically the very first program that any coder runs on any language, at least I do that. And this is how you can basically write a simple HW on Golang.

File: helloworld.go

package mainimport "fmt"func main() {
fmt.Println("Hello Go")
}

$ go run hello.go

Here is a cheat sheet by Ariel Mashraki to help you out with the very basics of Golang. Additionally, you can try out A Tour of Go, which is an exceptional foundation to Go. And that was the basic overview of what Golang is and how it is evolving the state of coding. We, at DSC KIIT, had a pretty interactive session on Golang and you can check it out.

From the beginning, the authors tried to make Go platform-independent and simple. The biggest challenge they faced, was to keep it simple for us developers. And that’s the bottom line and if you learned anything new today, drop a clap, 👏 as many as 50 times to show your support!

Resources

--

--