0

No Oops in Go/Golang

I recently had a chance to have a look into a new language Go here I will breif about what is not there and what is so special in this language.

Go often referred to as golang is a free and open source programming language from Google. It first appeared in November 2009.

It doesn’t support or have the following

  • Class
  • Function/Method overloading
  • Operator overloading
  • Optional parameter
  • Inheritance
  • Generics
  • No while keyword & extensively uses keyword for to achieve the same

It is not an Object oriented programming language instead its a structured, concurrent and compiled language.

So what is so special about golang? It is Concurrency. Don’t confuse parallism of C# or other languages with concurrency.

Concurrency is the composition of independently executing processes, while parallism is the simultaneious execution of (possibly realted) computations. 
Concurrency is about dealing with lot of things at once. Parallism is about doing lots of things at once - Rob Pike

 

Golang doesn’t use additional threads for concurrency that means it uses single thread and handles concurrency with goroutines (green threads). The goroutines are light weight whereas OS’s thread is heavy weight with 1 MB memory imprint whereas goroutines uses only in ~2 kilo bytes & it can dynamicaly grow based on the need. Goroutines are managed by golang itself. Since there is no additional thread Operating System can work efficiently with almost no queuing & swapping of the threads for golang.

Concurrency model of golang:

  • Actor model (In golang its called as goroutines)
  • Communicating Sequential Processes (In golang its called as channel)

Golang Gopher

This language has behaviour similar to the creature Gopher (So now you know why the name Go) which actually creates a network of tunnel/channel systems that provide protection for the means of collecting food. So what is so special about this language.

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.