Tagged articles
duck-typing
10 articles · Page 1 of 1
This article explains why relying heavily on Python's isinstance() for type checking leads to less flexible code, introduces the EAFP vs. LBYL philosophies, and shows when isinstance() is appropriate through clear examples and best‑practice guidelines.
EAFPMetaclassPython
0 likes · 8 min read

This article explains five essential Python functions for object inspection and type checking: type(), isinstance(), getattr(), hasattr(), and best practices for error handling.
Pythonduck-typingerror handling
0 likes · 4 min read

This article explains duck typing and polymorphism in Python, two fundamental object-oriented programming concepts, with practical code examples demonstrating how objects can be treated based on their behavior rather than their type.
Code ExamplesPythonduck-typing
0 likes · 8 min read

The article recounts the author’s repeated struggles with TypeScript, explains why treating it merely as a JavaScript superset leads to confusion, and provides a step‑by‑step, concept‑focused approach—including structural typing, conditional types, and practical code examples—to master the language’s type system.
Conditional TypesStructural TypingType System
0 likes · 8 min read

This article introduces the Maximum‑Minimum Principle, explaining how maximizing output guarantees while minimizing input constraints leads to stable, extensible designs that inherently fulfill SOLID principles without extra effort.
SOLID principlesduck-typinginterface design
0 likes · 9 min read

This article explains Python inheritance and polymorphism, covering single, multi‑level and multiple inheritance, method overriding, and duck‑type polymorphism with clear code examples and visual illustrations to help beginners grasp OOP fundamentals effectively.
InheritanceMultiple InheritanceOOP
0 likes · 8 min read

This article analyzes Go's duck typing and interface mechanisms, explaining how interfaces are defined, implemented, and converted at runtime, including details of underlying structures like iface and eface, method sets, pointer vs value receivers, and type assertions, supplemented with code examples and assembly insights.
GoRuntimeduck-typing
0 likes · 22 min read

This article explains Python’s dynamic features—duck typing and monkey patching—through clear analogies and practical code examples, demonstrating how objects are identified by behavior rather than type and how classes or modules can be modified at runtime without altering original source code.
Monkey PatchingPythonduck-typing
0 likes · 5 min read

The article thoroughly examines Go’s interface system, explaining static duck typing, the differences between value and pointer receivers, the internal iface/eface structures, how interfaces are constructed and converted, compiler implementation checks, type assertions, runtime polymorphism, and contrasts these mechanisms with C++ abstract‑class interfaces.
GoPolymorphismduck-typing
0 likes · 39 min read

This article explains the internal algorithm of Python's isinstance function, how it can be overloaded via __instancecheck__, the role of metaclasses, and provides concrete code examples and a step‑by‑step recreation of the check logic for better understanding of duck typing.
MetaclassPythonduck-typing
0 likes · 6 min read
