Learning GoLang after Ruby: What to Expect?

1. No Generic Functions

The first surprise and challenge for you as a Rubyist who is starting to work with GoLang: there are no our favorite built-in methods! There are no map, each, etc, In addition, there are no generic methods and beautiful constructions in the language.

2. Static Typing

You might be thinking: “I must start selecting the types of data in GoLang”. However, in GoLang there is a special operator for creating new variables :=. Using this operator, you can enable the compiler to guess the type of a variable. Example:

3. No Classes

This is not a typing mistake, there are indeed no classes in Go. You can ask: “How can I declare my own data types?” And the GoLang’s answer is use structs. Let’s start with an example:



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store