Loading…

Want to know everything. Go language

I hope you have already become acquainted with the latest ratings, so today article’s hero is somehow familiar. Last year, Go appeared in the news, popularity ratings were going up, the shelves were filled by professional books. Today, the hype has faded a bit as the developers evaluated the programming language quality. There is no sense to talk about total domination, but it became clear that Go had a bright future. Here, we want to tell you about this interesting programming language and discover its performance, syntax, and future prospects.

Want to know everything. Go language

A bit of history

In the mid-2000s, when Google’s computing power began to exceed all imaginable limits, the company needed a programming language able to work effectively with multi-threaded data. It was required to provide Google with a competitive advantage in search engine performance and third-party services.

In 2007, Google developers Robert Grismer, Rob Pike and Ken Thompson began the development. By the way, before that, they were developing the Inferno OS based on Plan 9, which is intended for building both network and distributed systems. The programming language name came from the evolution of Google Language to Golang and then just Go. Until 2009, developers had been creating syntax and basic architecture. Then the project became public and developers from all over the world had an opportunity to improve the language. Finally, the first full Go version was published in 2012.

The community did not appreciate the new language. The reason is that not so many companies and developers needed to optimize their projects’ performance at that time. Moreover, there were compatibility limitations with platforms (Plan 9 and Android support appeared only at the end of 2014). Interestingly, Google also did not contribute to the language popularization. Many people attribute the further growth of popularity to the frequent flickering in the media, but there is another version. Let’s pay attention to the TIOBE rating (it is similar in PYPL and other statistical aggregators):

A bit of history

 

As you can see, there is a huge 13 times rating jump in 2016. What a landmark event happened at that time? Actually, the well-known release of the mobile game Pokemon GO. Thus, the seekers of animals in augmented reality have become a programming language popularity booster.

A bit of history

Syntax

There are many syntax limitations in Go. Let’s take a closer look at some of them.

Here are the options of variable declaration: 

var i int

var (

  j float

  k int

)

Declaration and output:

i := j

 

The classic for loop:

for i := 0; i < n; i++ {

  println(arr[i])

}

A very useful property – for may not contain arguments (an infinite loop) or contain only one condition (an analogue of while).

Pay attention to the curly brackets, Go is a strictly regulated place of opening and closing, additional hyphenation is not allowed.

Here is an example of Hello World:

package main

import "fmt"



func main() {

  fmt.Println("Hello, World!")

}

Generally, despite the syntax structure is somewhat obsolete with numerous limitations, you need to code at least 30 minutes using Go, and you will definitely love it. 


Leave a Comment