5 ms·
Clever! But what problem does this actually solve? When I see a type alias of a string and enumerated variants then why would I pass in arbitrary strings? Th
by dgb23 3y ago
Clever!
But what problem does this actually solve?
When I see a type alias of a string and enumerated variants then why would I pass in arbitrary strings?
There are _always_ ways to break assumptions. Putting arbitrary, complex guard rails at every call site doesn’t make a program magically better.
An API is primarily about affordances. We provide utility to the caller.