(no title)
dsfasfd | 1 year ago
Go does have operator overloading, for example + is overloaded for float.., int.. and even non numeric types like string.
And it does so for a very good reason: having operator overloading makes code much more readable when used correctly. It's just that the language designers didn't trust their users.
As long as you know the types of x and y you always know precisely what x + y does, same as you know what x.Add(y) does. There's no difference.
vincentkriek|1 year ago
And verbosity helps, forcing users verbosity helps the general level of quality. Programmers could overestimate themselves and think they are doing it correctly. Looking back in my code from a year ago I see things I should have done differently. I like languages that avoid me making real dumb mistakes