3 ms·
> It's a bad idea for the same reason that having a function that returns back multiple values is a bad idea. Every single language that lacks multiple return
by marcosdumay 10y ago
> It's a bad idea for the same reason that having a function that returns back multiple values is a bad idea.
Every single language that lacks multiple return values has some kind of hack to compensate, like varying parameters, that breaks encapsulation and makes code inconsistent.
- atoko 10y agoYou could also wrap your output in a struct, or tuple if so inclined
- marcosdumay 10y agoOn a tuple, yes. That's how most language implement returning multiple values, but you need good accessors. On a struct you'll need to declare it first.