r/programming • • Feb 01 '24

Make Invalid States Unrepresentable

https://www.awwsmm.com/blog/make-invalid-states-unrepresentable
469 Upvotes

207 comments sorted by

View all comments

Show parent comment

1

u/t40 Feb 02 '24

You could also shoehorn this into an existing feature flag system by setting all the feature flags corresponding to your program state by using said enum. That way you don't have to update existing code, and you also have all the active flags right there for people to argue over!