Comment on Functional State Machines in Rust: Typestate and Newtype PatternsparentComments−scns12dMaking sure something can be only used correctly is bad? Why?−stouset12dMaking functions that must be called in a specific, pre-defined order is the problem.Forcing it to be done correctly through the type system is a neat trick, but better is to design it so the trick wasn’t needed in the first place.
Comments
Making sure something can be only used correctly is bad? Why?
Making functions that must be called in a specific, pre-defined order is the problem.
Forcing it to be done correctly through the type system is a neat trick, but better is to design it so the trick wasn’t needed in the first place.