2 ms·
I'm as much a dynamic language person as a static language person - I write as much python as I do Scala. The point is that the guarantees you can get go well b
by yummyfajitas 11y ago
I'm as much a dynamic language person as a static language person - I write as much python as I do Scala. The point is that the guarantees you can get go well beyond simply assert(type(x) == str). See the examples in my previous post - you can guarantee at the type level that a list isn't empty, or that a boolean formula only contains predicates that can be rendered to javascript.
These are things I'd have lots of unit tests for.
Here is another example of using static types to fix a problem I constantly run into in Python (adding vectors from the wrong vector spaces together):
https://www.chrisstucchio.com/blog/2014/type_safe_vector_addition_with_dependent_types.html https://www.chrisstucchio.com/blog/2014/type_safe_vector_add...