3 ms·
In addition to all the problems others have already noted, duck typing also loses the machine-checked documentation of explicit typing. With types, I don't have
by car_analogy 4y ago
In addition to all the problems others have already noted, duck typing also loses the machine-checked documentation of explicit typing. With types, I don't have to guess what a function accepts or returns, and when I refactor, I can count on the compiler to find many issues for me.
This is not a tradeoff, where I sacrifice development speed for safety. I gain speed, because types help guide me, and catch errors I would otherwise need tests for.