2 ms·
It actually makes the code concise and clearer. e.g. (int, float, float) calcPosition(...) { ... return (type, x, y); } var (type, x, y)
by ww520 11y ago
It actually makes the code concise and clearer. e.g.
(int, float, float) calcPosition(...) {
...
return (type, x, y);
}
var (type, x, y) = calcPosition(...);
if (type)
move(x, y);
or
var (int type, float x, float y) = calcPosition(...);
I would prefer the first case with automatic type inference.