Hacker News new | past | comments | ask | show | jobs | submit login

You are presenting it as an exclusive "or" question, when in fact you just do both.

You add a variant, and the compiler will lead you to all of the places where you need to handle that variant.

Or you remove a variant, and the compiler will tell you about all of the places where your made assumptions about such a variant existing are now invalid, including the tests that you wrote when you implemented the variant in the first place.

Welcome to compiler driven development.

Of course it helps when sum types and pattern matching are a first class feature of your language.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: