5 things about programming I learned with Go

Click for: original source

MichaƂ Konarski interesting and engaging post about his journey with golang programming language. Author explains why even if you do not plan to use it in the long run, Go is worth the effort.

Author likes the fact that there is an ongoing discussion whether Go is or is not an object-oriented language and that it is possible to have both dynamic-like syntax and static safety. Sometimes inheritance seems like a perfect answer for increasing demands, but with larger projects it can become overwhelming and maintenance becomes hard. With Go you can avoid inheritance and prefer composition instead.

Channels and goroutines are powerful way to solve problems involving concurrency. Go scheduler is smart enough to automatically utilize all CPU cores. Goroutines are small and lightweight, therefore you can easily create many of them and get advanced parallelism for free.

With Go you do not communicate by sharing memory, share memory by communicating. Instead of using locks to control access to a shared resource, they can simply use channels to pass around its pointer. Author also points out the fact that Go is different, because it doesn’t have the concept of exceptions by design.

Good read with many code examples and explanations.

[Read More]

Tags programming golang