News for hackers. Stuff that matters.
Re:Surface Tension of Software by ttoinou on Sunday December 14, 2025 @05:37AM (#46262137)

   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
Re:Surface Tension of Software by qezz on Sunday December 14, 2025 @05:49AM (#46262175)
> 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.

Re:Surface Tension of Software by wvbdmp on Sunday December 14, 2025 @05:40AM (#46262146)
Then you have to take care of nobody ever writing the wrong state, which is increasingly annoying the more people work on the thing.