Object-Oriented Programming
OOP concepts in JavaScript and Python — from fundamentals to design patterns, through the lens of each language.
JavaScript
Objects Fundamentals
Creating, accessing, and manipulating objects — the foundation of everything in JS.
Constructor Functions & the new Keyword
How new works under the hood and how constructor functions create objects.
Prototypes & the Prototype Chain
How JavaScript objects inherit through the prototype chain — the core of JS's object model.
ES6 Classes
Classes as syntactic sugar over prototypes — constructor, methods, and static members.
Inheritance: extends & super
Setting up class hierarchies, calling parent constructors and methods.
Encapsulation & Private Fields
True privacy in JS with #private fields, closures, and WeakMap patterns.
Polymorphism in JavaScript
Method overriding, duck typing, and how JS achieves polymorphism without interfaces.
Abstraction Patterns
Enforcing contracts and hiding complexity in a language without abstract classes.
this Keyword & Execution Context
How this is determined in different contexts and why it matters for OOP in JS.
Getters, Setters & Proxy
Computed properties, validation with accessors, and meta-programming with Proxy.
Mixins & Composition over Inheritance
Why favor composition and how to implement mixins, delegation, and composition in JS.
Symbols & Well-Known OOP Protocols
How Symbols power JS's built-in OOP protocols: iteration, type conversion, and more.
SOLID Principles in JavaScript
Applying SOLID to JS with practical, idiomatic examples using classes, modules, and functions.
OOP Design Patterns in JavaScript
Key creational, structural, and behavioral patterns implemented with JS classes and closures.
Python
Classes & Instances
Defining classes, creating objects, and understanding self, __init__, and attributes.
Method Types: Instance, Class & Static
The three kinds of methods in Python and when to use each.
Inheritance & MRO
Single and multiple inheritance, super(), the diamond problem, and C3 linearization.
Encapsulation & Name Mangling
Python's approach to access control: conventions, name mangling, and property-based encapsulation.
Polymorphism & Duck Typing
Method overriding, operator overloading, and Python's duck typing philosophy.
Dunder Methods Deep Dive
The Python data model — customizing object creation, representation, comparison, arithmetic, and context.
Property Decorators & Descriptors
@property for Pythonic getters/setters, and the descriptor protocol that powers it all.
Abstract Classes & ABC
Enforcing method contracts with abc.ABC, @abstractmethod, and Python's Protocol.
Dataclasses & NamedTuple
Reducing boilerplate for data-holding classes with @dataclass and typed named tuples.
__slots__ & Memory Optimization
Restricting attributes with __slots__ for memory savings and faster attribute access.
Composition vs Inheritance
The has-a vs is-a debate in Python with practical refactoring examples.
Metaclasses
Classes that create classes — type, __new__ vs __init__, and custom metaclasses.
Protocols & Structural Subtyping
typing.Protocol for static duck typing — Python's answer to interfaces without inheritance.
SOLID Principles in Python
Applying SOLID to Python with idiomatic examples using ABCs, protocols, and first-class functions.
OOP Design Patterns in Python
Key patterns implemented the Pythonic way — leveraging decorators, duck typing, and first-class functions.