Re:Show HN: PySchemes – A library for validating data struct...
by rcthompson on Sunday November 05, 2017 @10:16AM
(#15629761)
They're not mutually exclusive. Static type checking is fine if you can cover all your code with it, but it doesn't enforce anything at runtime. If you're writing a library that will be called by other people's code (which likely won't be statically type-checked), it might still be useful to validate your functions' inputs at runtime.
[ Parent
| on HN ]
Re:Show HN: PySchemes – A library for validating data struct...
by StavrosK on Sunday November 05, 2017 @10:25AM
(#15629798)
True, and I guess it helps for when your non-validated code calls validated code. Odd how we've come around to realizing the importance of types and contracts after years of dynamic typing.
It's a bit like document databases, people are starting to realize again how convenient relational databases and how helpful schemas are.
Re:Show HN: PySchemes – A library for validating data struct...
by rcthompson on Sunday November 05, 2017 @01:44PM
(#15630856)
To be a little more clear, in a language where static typing was mandatory, there would obviously be no need for dynamic type checking of those same types. But since Python's static typing is optional, dynamic type checking at runtime is not redundant.