Roman Elizarov
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.

--

--

Roman Elizarov
Roman Elizarov

Written by Roman Elizarov

Project Lead for the Kotlin Programming Language @JetBrains

No responses yet