4 ms·
Duck typing and structural are not the same thing (for safety), IMHO. I think Structural is safer and better overall, and the best exponent is the relational/s
by mamcx 4y ago
Duck typing and structural are not the same thing (for safety), IMHO.
I think Structural is safer and better overall, and the best exponent is the relational/sql model.
What make it good is that structural types are more about the data itself, and if the code is around that concept, is very productive and safe in practique.
What make Duck typing unsafe is that is easy to "break" the type in runtime (ie: monkey patching, adding or removing things) and this is what I expect structural to retain it safety better...