Why Duck Typing Is Safe
I have seen a lot of programmers over the years express concerns; what if something accidentally conforms to an interface and causes some horrible bug? What if I have an interface for
Shoot()
for a video game and some object wanders in thatShoot()
s a real gun by accident? Isn't it safer to formally declare conformance?
Source: Why Duck Typing Is Safe, an article by Jeremy Bowers.