3 ms·
The line itself is longer, but the idiom in the original uses mutation, which requires reading more adjacent lines to understand and make sure you haven't misse
by eru 4y ago
The line itself is longer, but the idiom in the original uses mutation, which requires reading more adjacent lines to understand and make sure you haven't missed anything.
(In the concrete example, both versions use mutation.)
- pansa2 4y agoI'm not sure I understand. Could you give a concrete example where only one version uses mutation?
- dragonwriter 4y agoAny example that does what the proposed ??= operator does, which is inherently conditional mutation, will use mutation. You can get examples equivalent to the proposed None-coalescing ?? operator does that don't use mutation, though.