24
Why is Go syntax so messy
(lemmy.ca)
Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!
Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.
Hope you enjoy the instance!
Rules
Follow the wormhole through a path of communities !webdev@programming.dev
The
:=
operator is called walrus operator and is inspired by Python I think. It's declaring a variable and assigning it in one go.map[string] int
is defining a map (associative array or also known as dictionary in Python), with string as key type and int as value type. And the following{}
is the body of the associative array, meaning empty content.I only played a bit with Go and did basic tutorials. I might go back to it at some point, but Zig is much more appealing to me. Go is too simple in the language to me, but on the other side, this is exactly whats appealing.
@thingsiplay @urska I love this, I've been learning some VBA lately and it uses this. I'm much happier knowing it's got an adorable name.