4 ms·
> In that case you never gain the advantage of dynamic languages. Treating the code as statically typed makes the code predictable, less prone to bugs, and eas
by root_axis 8y ago
> In that case you never gain the advantage of dynamic languages.
Treating the code as statically typed makes the code predictable, less prone to bugs, and easier to maintain. If a function's return type is determined by dynamic factors at run-time, it becomes a maintenance and debugging nightmare; the effect is compounded as more and more unpredictable dynamic functions are chained together.
> operate on function arguments regardless of type
parameterized types and other techniques allow you to describe this type of behavior in a type safe way.
> Or generic validation utils that take many types and return the passed in type after performing internal validation logic relevant to the type.
All these things are possible in typed languages.