4 ms·
To rip out a little of the reply by tetha above: "If you have duck typing, the programmer needs to do this work, by defining clear interfaces with clear docume
by Paddy3118 17y ago
To rip out a little of the reply by tetha above:
"If you have duck typing, the programmer needs to do this work, by defining clear interfaces with clear documentations about the expected behavior of an object passed in here or returned over there."
A compiler does not define clear interfaces with clear documentation for you. If you are implying that to use duck typing, this is more likely to be done by a programmer then this is a good thing; no matter what the typing.
In practice duck typing helps to get rid of needless duplication, and extended class hierarchies in code, and proponents would state that less code is easier to verify.
- Paddy.