3 ms·
What does it mean when loading is false, error is Some, and data is also Some? The type allows nonsense. You write defensive checks everywhere. Every render mus
by ttoinou 10mo ago
What does it mean when loading is false, error is Some, and data is also Some? The type allows nonsense. You write defensive checks everywhere. Every render must guess which combination is real
How about you never write the wrong state in the first place ? Then you have nothing to take care of
- wvbdmp 10mo agoThen you have to take care of nobody ever writing the wrong state, which is increasingly annoying the more people work on the thing.
- qezz 10mo ago> How about you never write the wrong state in the first place ? Indeed, and tagged unions (enums in Rust) explicitly allow you to avoid creating invalid state.