Go Observations

A Julia developer returns to Golang and is impressed by the simplicity and speed of the Go toolchain.

Erik Engheim
Star Gazers

--

I did a bunch of Go programming the past and even held conference talks on Go. But I have been away from Go for a while and did both Swift and Julia programming in the meantime.

Fortunately, Go has remained remarkably stable as a language since I first picked it up, so I don’t have to learn a lot of new things. Rather, it is more of a refresher. The key new thing for me to learn are Go modules as well as familiarizing myself with the tooling around the language. I feel this is where most development has happened.

Here are a few observations of things that are easy to forget but that are important to remember.

You Don’t Need Constructors Most of the Time

I noticed that I had gotten into the habit of adding constructor functions. This is unnecessary and just inflexible in Go.

Go does not have constructors in the language per se but there are conventions for making functions with the New prefix for making objects. This is how I initially made a constructor for a RigidBody. If you’re wondering what that is, it is basically something from physics to simulate how an object that is not elastic moves…

--

--

Erik Engheim
Star Gazers

Geek dad, living in Oslo, Norway with passion for UX, Julia programming, science, teaching, reading and writing.