1 min readJun 23, 2020
Yes. require
is a great way to check preconditions in your functions in cases when a violation of these pre-conditions indicates a bug somewhere in your program logic. However, if you can redesign your code to introduce tighter types that check at compile-time that’s even better. Not always possible, though.