GO (Golang) was developed by Google and it’s getting popularity recently and this is why:
Go is extremely fast!
GO performance is similar to C++ because it’s compiled to machine code.
Concurrency Management Mechanism
GO uses innovative concurrency management mechanism that is very powerful and at the same time easy to use.
In short GO can create so called goroutines that are very efficient and developer may use channels for communication between them.
Since modern CPUs have more and more cores efficient concurrency is crucial and GO runtime handles all the complexity. In order to create new goroutine you just need to add “go” keyword before the function call.
Dependency management
No more dependency hell! Every used module or package is just inside your compiled executable file. Just run it with GO!
Easy to Read and Statically Typed
Despite writing code in GO takes slightly more effort than with Python on other hand it gives you security that you always know for sure what type you work with and at the same time GO code is easy to read. This makes GO more suitable for serious big project development.
package main
import (
"fmt"
"time"
)
func chat(s string) {
for i := 1; i < 5; i++ {
time.Sleep(1000 * time.Millisecond)
fmt.Println(s)
}
}
func main() {
go chat("GO!")
chat("Hello")
}
Fast Compiling
It takes seconds to compile relatively big GO project.
Garbage Collection
GO has garbage collection mechanism called goLand.
Good for Big Serious Projects
Because of static typing and ease to read code GO is more suitable for big projects than Python.
It will be easy for developer to read, understand and therefore support and extend the existing code which was written by someone else.
Read our next post: Your First HTTP Server in GO
[…] we already know why to choose GO over Python, therefore today I’ll show an example of a simple GO HTTP Server project in Visual Studio […]