3 ms·
I agree. I feels like this naming disconnect would not exist in this case if you would work with a record/struct. That is what you sacrefice with tuples.
by olodus 4y ago
I agree. I feels like this naming disconnect would not exist in this case if you would work with a record/struct. That is what you sacrefice with tuples.
- codefined 4y agolet { value, weight } = if values.empty() { { value: 0, weight: 1.0 } } else { { value: values[0], weight: 1 / values.len() } } Using JS style object expansion, instead of tuple expansion.
- edflsafoiewq 4y agoYou would use a struct here to initialize two variables? The disconnect already exists, multiple variables or many else-if branches just accentuates it.