Skip to content

Instantly share code, notes, and snippets.

@decagondev
Created May 13, 2026 16:15
Show Gist options
  • Select an option

  • Save decagondev/4dd2a83e710c2c7aeff99baeb77106f3 to your computer and use it in GitHub Desktop.

Select an option

Save decagondev/4dd2a83e710c2c7aeff99baeb77106f3 to your computer and use it in GitHub Desktop.

๐Ÿ“– Theory-First Learning Materials


๐Ÿ› ๏ธ Practice Projects (One App, Three Paradigms)

The best way to understand theory is to build the exact same project three different ways. The following lightweight projects can easily be adapted across all three paradigms:

1. The Bank Account / Wallet Tracker

  • Procedural Approach: Create a global variable or dictionary representing the wallet. Write sequential functions like deposit(amount) and withdraw(amount) that directly mutate that global variable.
  • OOP Approach: Create a BankAccount class. Encapsulate the balance as a private property. Use methods like account.deposit() to alter the internal state of individual object instances.
  • Functional Approach: Keep the state entirely immutable. Write pure functions that take a currentBalance and an amount as arguments, returning a completely new balance integer without altering the original variables.

2. Text-Based Adventure Game / State Machine

  • Procedural Approach: Use nested loops, if/else statements, and global flags to move a player sequentially through rooms.
  • OOP Approach: Create Room, Player, and Item classes. Use polymorphism so different types of rooms or items react uniquely when interacted with.
  • Functional Approach: Treat the entire game state as a single data structure. Use pure functions and recursion to pass the old game state into a function and output a new, updated game state slice based on user choice.

3. Data Filter & Analytical Dashboard

  • Procedural Approach: Use a for loop to step through a raw dataset line by line, appending passing items to a new list manually.
  • OOP Approach: Create a DataStream or Dataset class with internal methods to load, filter, and transform data objects.
  • Functional Approach: Use chained higher-order functions like map(), filter(), and reduce() to pipe raw data through transformations without ever mutating the source data array.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment