If you are going to add a bunch of asserts, why not just use types?
Re:Diminishing returns of static typing
by crdoconnor on Monday October 02, 2017 @05:14PM
(#15388029)
I don't particularly see the need to extend this approach to every single variable in my code base. I usually just stick it on boundary code.
By adding sanity checking asserts in a dynamically typed language you can achieve more or less the same result.