3 ms·
> It's entirely possible to return three or four values from a Go method (if not common). Not sure how it’s an issue, you just could not use the shortcut for t
by masklinn 5y ago
> It's entirely possible to return three or four values from a Go method (if not common).
Not sure how it’s an issue, you just could not use the shortcut for this “not common” situation, or the case where the result is an actual product.
That Rust added ? Did not make every developer forget how to process values.
> The error shortcuts in Rust confuse me more often than not.
I have a hard time understanding that. The desugaring is hardly complicated, and the semantics are straightforward.
- sofixa 5y ago> Not sure how it’s an issue, you just could not use the shortcut for this “not common” situation, or the case where the result is an actual product But the whole point of Go is that code is more often read than written, so legibility is paramount. Having a `?` operator alongside the traditional `if err != nil` would be very confusing.
- masklinn 5y ago> But the whole point of Go is that code is more often read than written, so legibility is paramount. Having a `?` operator alongside the traditional `if err != nil` would be very confusing. Are you confused by unnamed returns? By the ability to declare variables initialised or not? By there being two syntaxes to declare variables? By it being possible to elide types in declarations or parameters lists? Go is already full of shortcuts which I would say are more confusing and less useful than`?`