Duck Typing
Duck typing is a concept in programming, particularly in languages like Python and Ruby, where the type or class of an object is determined by its behavior rather than its explicit type. The idea is that if an object behaves like a certain type (for example, it has specific methods or properties), it can be treated as that type, regardless of its actual class.
This approach allows for more flexible and dynamic code, as developers can write functions that accept any object that meets the required interface. It emphasizes the importance of what an object can do, rather than what it is, promoting a more adaptable coding style.