Object-Oriented Programming

OOP concepts in JavaScript and Python — from fundamentals to design patterns, through the lens of each language.

14 JavaScript
Objects Fundamentals Constructor Functions & new Prototypes & Prototype Chain ES6 Classes Inheritance Encapsulation & Private Fields Polymorphism Abstraction Patterns this Keyword & Context Getters, Setters & Proxy Mixins & Composition Symbols & OOP Protocols SOLID Principles Design Patterns
15 Python
Classes & Instances Method Types Inheritance & MRO Encapsulation & Name Mangling Polymorphism & Duck Typing Dunder Methods Properties & Descriptors Abstract Classes & ABC Dataclasses & NamedTuple __slots__ & Memory Composition vs Inheritance Metaclasses Protocols & Structural Subtyping SOLID Principles Design Patterns

JavaScript

1

Objects Fundamentals

Creating, accessing, and manipulating objects — the foundation of everything in JS.

beginner objects properties methods
2

Constructor Functions & the new Keyword

How new works under the hood and how constructor functions create objects.

beginner constructor new instanceof
3

Prototypes & the Prototype Chain

How JavaScript objects inherit through the prototype chain — the core of JS's object model.

intermediate prototype prototype-chain __proto__
4

ES6 Classes

Classes as syntactic sugar over prototypes — constructor, methods, and static members.

intermediate class constructor static
5

Inheritance: extends & super

Setting up class hierarchies, calling parent constructors and methods.

intermediate extends super inheritance
6

Encapsulation & Private Fields

True privacy in JS with #private fields, closures, and WeakMap patterns.

intermediate encapsulation private-fields WeakMap
7

Polymorphism in JavaScript

Method overriding, duck typing, and how JS achieves polymorphism without interfaces.

intermediate polymorphism method-overriding duck-typing
8

Abstraction Patterns

Enforcing contracts and hiding complexity in a language without abstract classes.

intermediate abstraction factory-functions interface-emulation
9

this Keyword & Execution Context

How this is determined in different contexts and why it matters for OOP in JS.

intermediate this bind call
10

Getters, Setters & Proxy

Computed properties, validation with accessors, and meta-programming with Proxy.

intermediate getters setters Proxy
11

Mixins & Composition over Inheritance

Why favor composition and how to implement mixins, delegation, and composition in JS.

advanced mixins composition delegation
12

Symbols & Well-Known OOP Protocols

How Symbols power JS's built-in OOP protocols: iteration, type conversion, and more.

advanced Symbol Symbol.iterator Symbol.toPrimitive
13

SOLID Principles in JavaScript

Applying SOLID to JS with practical, idiomatic examples using classes, modules, and functions.

advanced SOLID SRP OCP
14

OOP Design Patterns in JavaScript

Key creational, structural, and behavioral patterns implemented with JS classes and closures.

advanced design-patterns singleton factory

Python

15

Classes & Instances

Defining classes, creating objects, and understanding self, __init__, and attributes.

beginner classes objects self
16

Method Types: Instance, Class & Static

The three kinds of methods in Python and when to use each.

beginner methods staticmethod classmethod
17

Inheritance & MRO

Single and multiple inheritance, super(), the diamond problem, and C3 linearization.

intermediate inheritance super MRO
18

Encapsulation & Name Mangling

Python's approach to access control: conventions, name mangling, and property-based encapsulation.

intermediate encapsulation name-mangling private
19

Polymorphism & Duck Typing

Method overriding, operator overloading, and Python's duck typing philosophy.

intermediate polymorphism duck-typing EAFP
20

Dunder Methods Deep Dive

The Python data model — customizing object creation, representation, comparison, arithmetic, and context.

intermediate dunder magic-methods data-model
21

Property Decorators & Descriptors

@property for Pythonic getters/setters, and the descriptor protocol that powers it all.

intermediate property descriptors getter
22

Abstract Classes & ABC

Enforcing method contracts with abc.ABC, @abstractmethod, and Python's Protocol.

intermediate ABC abstractmethod abstract-class
23

Dataclasses & NamedTuple

Reducing boilerplate for data-holding classes with @dataclass and typed named tuples.

intermediate dataclass NamedTuple frozen
24

__slots__ & Memory Optimization

Restricting attributes with __slots__ for memory savings and faster attribute access.

intermediate __slots__ memory optimization
25

Composition vs Inheritance

The has-a vs is-a debate in Python with practical refactoring examples.

intermediate composition inheritance has-a
26

Metaclasses

Classes that create classes — type, __new__ vs __init__, and custom metaclasses.

advanced metaclass type __new__
27

Protocols & Structural Subtyping

typing.Protocol for static duck typing — Python's answer to interfaces without inheritance.

advanced Protocol structural-subtyping typing
28

SOLID Principles in Python

Applying SOLID to Python with idiomatic examples using ABCs, protocols, and first-class functions.

advanced SOLID SRP OCP
29

OOP Design Patterns in Python

Key patterns implemented the Pythonic way — leveraging decorators, duck typing, and first-class functions.

advanced design-patterns singleton factory