In Go, the error is at the end merely because of convention. Since errors are values and could be any type, there is no restriction on ordering. You could put the error value before the actual result and not even gofmt would change it. It just wouldnt be idiomatic Go code.
Zig is different. Errors are part of a type in Zig, like Matlad is saying. So the compiler enforces and ordering. And it also forces the unwrap ordering, which is left to right, so you have to unwrap the error before you get the value.
To me, this matches the return type signature. If the catch is the ! then the function call matches error and the right side is the value. In fact if catch provides a value at all, it has to match the return type of get_age.
I think Haskell uses Either.Left (I donât remember the syntax from the top of my head) for errors and Either.Right for success, by convention in that case.
The vibes are in fact immaculate. I say this with love, but some of yâall are so intimidatingly competent that I get surprised youâre also helpful.