Skip to main content
AmigoFish

ArjanCodes

ArjanCodesVideoLast show:

Not rated yet

About this show

On this channel, I post videos about programming and software design to help you take your coding skills to the next level. I'm an entrepreneur and a university lecturer in computer science, with more than 20 years of experience in software development and design. If you're a software developer and you want to improve your development skills, and learn more about programming in general, make sure to subscribe for helpful videos.

I post a video here every Friday. If you have any suggestion for a topic you'd like me to cover, just leave a comment on any of my videos and I'll take it under consideration.

Thanks for watching!

Videos come from the channel's public YouTube feed. The artwork is the newest video thumbnail. Last updated . Names, artwork and text belong to their publishers.

Cosmos

Similar by topic and creator

See the full Cosmos

Videos

  • I’m done with the AI hype

    · 8 min

    🧱 Build software that lasts. Join the Software Design Mastery waiting list → https://arjan.codes/mastery I’m done with the AI hype. In this video, I explain why I think a lot of the current discussion around AI in software development is missing the point. Writing code is only a small part of what developers actually do. Design, responsibility, trade-offs, and understanding systems matter far more, especially in real-world environments where mistakes are expensive. 🎓 ArjanCodes Courses: https://www.arjancodes.com/courses. 💬 Join my Discord server: https://discord.arjan.codes. ⌨️ Keyboard I’m using: https://amzn.to/49YM97v. 🔖 Chapters: 0:00 Intro 0:58 What is software development? 4:23 Future 5:17 Fundamentals #arjancodes #softwaredesign #python

    Not rated yet
  • Let’s Fix Bloated Python Classes Once and For All

    · 14 min

    🧱 Build software that lasts. Join the Software Design Mastery waiting list → https://arjan.codes/mastery. This class looks clean… until it quietly turns into a God object. In this video, I refactor a real Python example step by step, showing how one class slowly takes on too many responsibilities. From validation to data processing to model training. Then I break it apart into smaller, clearer pieces and introduce a simple rule of thumb for deciding what belongs in a class and what doesn’t. 🔥 GitHub Repository: https://git.arjan.codes/2026/god. 🎓 ArjanCodes Courses: https://www.arjancodes.com/courses. 💬 Join my Discord server: https://discord.arjan.codes. ⌨️ Keyboard I’m using: https://amzn.to/49YM97v. 🔖 Chapters: 0:00 Intro 1:54 The Starting Point 4:10 Step 1: Move Validation Close to the Data 6:54 Step 2: Split Loading and Cleaning 8:02 Step 3: Split Feature Preparation Into Smaller Steps 9:06 Step 4: Move the Remaining Workflow Out of the Class 11:28 Step 5: Keep the Class for What It’s Good At 12:13 Why This Refactor Works 14:37 Final Thoughts #arjancodes #softwaredesign #python

    Not rated yet
  • DRY Often Makes Your Code Worse

    · 13 min

    🧱 Build software that lasts. Join the Software Design Mastery waiting list → https://arjan.codes/mastery. In this video, I show how a “clean” DRY refactor can actually make your code worse. Instead of improving the design, it introduces hidden complexity, confusing flags, and harder-to-understand behavior. Then we refactor it again, this time focusing on behavior and responsibilities, not just code shape. 🔥 GitHub Repository: https://git.arjan.codes/2026/dry. 🎓 ArjanCodes Courses: https://www.arjancodes.com/courses. 💬 Join my Discord server: https://discord.arjan.codes. ⌨️ Keyboard I’m using: https://amzn.to/49YM97v. 🔖 Chapters: 0:00 Intro 0:30 The Bad Refactor First 3:58 What This Teaches About DRY 4:48 A Better Refactor 10:24 Some Duplication Is Actually Good 11:21 Quick Guidelines 12:36 Final Thoughts #arjancodes #softwaredesign #python

    Not rated yet
  • Your API Can’t Handle Real-World Integrations

    · 13 min

    🧱 Build software that lasts. Join the Software Design Mastery waiting list → https://arjan.codes/mastery. Your clean API works… until integrations start piling up. One system needs an extra ID, another needs a reference, and suddenly your schema turns into a mess. In this video, I show a cleaner way to handle this using a flexible `custom_data` design that keeps your API structured without turning it into a junk drawer. 🔥 GitHub Repository: https://git.arjan.codes/2026/apidata. 🎓 ArjanCodes Courses: https://www.arjancodes.com/courses. 💬 Join my Discord server: https://discord.arjan.codes. ⌨️ Keyboard I’m using: https://amzn.to/49YM97v. 🔖 Chapters: 0:00 Intro 1:05 The Starting Point 2:35 The Real Problem 4:11 The Design We Want 4:50 Where the Logic Should Live 5:30 The Reusable Base Model 8:58 The API Schemas 10:50 Why This Pattern Works Well 11:17 When To (Not) Use It 12:12 Final Thoughts #arjancodes #softwaredesign #python

    Not rated yet
  • Don’t Use Boolean Flags in Python, Use Policies Instead

    · 15 min

    🧱 Build software that lasts. Join the Software Design Mastery waiting list → https://arjan.codes/mastery. In this video, I show how to replace growing conditional logic with the Policy Pattern. Instead of one big function, you split rules into small, composable pieces and combine them into a flexible pipeline. The result is code that’s easier to extend, test, and control even with feature flags or configuration. 🔥 GitHub Repository: https://git.arjan.codes/2026/policy. 🎓 ArjanCodes Courses: https://www.arjancodes.com/courses. 💬 Join my Discord server: https://discord.arjan.codes. ⌨️ Keyboard I’m using: https://amzn.to/49YM97v. 🔖 Chapters: 0:00 Intro 2:11 The Problem 2:34 The Policy Pattern 3:05 OOP Version (Quick Overview) 5:50 Strategy vs Policy 6:51 Functional Style (Pythonic Version) 10:56 Policy Registry + Settings 13:37 Why This Is Powerful 14:07 Trade-offs 14:22 Final Thoughts #arjancodes #softwaredesign #python

    Not rated yet
  • What Most Python Developers Miss About Generators

    · 24 min

    Talk to the internet when you need answers. Talk to Recall when you need your answers. 🔗 https://www.recall.it/?t=arjan Use code ARJAN25 for 25% off, valid until 1 June 2026. Do the Ports & Adapters quiz here: https://app.getrecall.ai/challenge/e24770a5-1aab-5d6c-b2a8-dbee424c22a4 Most Python developers think generators are just about saving memory. That’s only a small part of the story. In this video, I show how generators give you control over when work happens, and how you can use them to build powerful data pipelines, handle backpressure, enable two-way communication, and even work with async streams. 🔥 GitHub Repository: https://git.arjan.codes/2026/generators. 🎓 ArjanCodes Courses: https://www.arjancodes.com/courses. 💬 Join my Discord server: https://discord.arjan.codes. ⌨️ Keyboard I’m using: https://amzn.to/49YM97v. 🔖 Chapters: 0:00 Intro 0:44 What are Generators? 1:44 Step 1: From Strings to Structured Data 6:36 Sponsored Section (recall.it) 9:08 Step 2: Pipelines with Function Composition 13:15 Step 3: Backpressure — Why This Scales 15:08 Step 4: Two-Way Communication with send() 17:52 Bonus: Generators Can Return a Value 19:08 Step 5: Async Generators 22:58 Final Thoughts #arjancodes #softwaredesign #python

    Not rated yet
  • The State Pattern Done the Pythonic Way

    · 26 min

    🧱 Build software that lasts. Join the Software Design Mastery waiting list → https://arjan.codes/mastery. The classic State design pattern is often implemented with many small classes and heavy inheritance. In this video, I show a different approach. I start with the traditional object-oriented version and then refactor it into a generic, data-driven state machine using Python features like decorators, enums, and generics. The result is a clean, reusable engine where transitions are explicit and easy to understand. 🔥 GitHub Repository: https://git.arjan.codes/2026/state. 🎓 ArjanCodes Courses: https://www.arjancodes.com/courses. 💬 Join my Discord server: https://discord.arjan.codes. ⌨️ Keyboard I’m using: https://amzn.to/49YM97v. 🔖 Chapters: 0:00 Intro 3:24 Why This Matters 4:11 Step 1 — The Traditional Class-Based State Pattern 4:57 Step 2 — Realization: This Is Just a Lookup Table 5:21 Step 3 — Extracting a Generic StateMachine 17:35 Step 4 — Making Transitions Declarative with a Decorator 20:37 Step 5 — Supporting Multiple From States 24:05 The Payment Class Becomes Boring (In a Good Way) 25:30 When To Use This vs Classic OO 25:54 Final Thoughts #arjancodes #softwaredesign #python

    Not rated yet
  • Python Has Serious Problems, But I Use It Anyway

    · 10 min

    🧱 Build software that lasts. Join the Software Design Mastery waiting list → https://arjan.codes/mastery. In this video, I explain what I didn’t like about Python when I first encountered it. From indentation and runtime errors to packaging and performance, and why many of those criticisms are still valid. More importantly, I explain why I still choose Python anyway. 🎓 ArjanCodes Courses: https://www.arjancodes.com/courses. 💬 Join my Discord server: https://discord.arjan.codes. ⌨️ Keyboard I’m using: https://amzn.to/49YM97v. 🔖 Chapters: 0:00 Intro 0:57 Languages That I Used 2:44 What I Didn’t Like About Python 5:49 Why Still Use Python? 7:30 The Lesson 9:25 Final Thoughts #arjancodes #softwaredesign #python

    Not rated yet
  • Why “Clean Code” Often Creates Worse Designs

    · 26 min

    → Get started with Hostinger today: http://hostinger.com/arjancodes (make sure to use coupon ARJANCODES). In this video, I refactor a small Python program that looks clean on the surface but hides a messy design underneath. Step by step, I remove unnecessary abstractions and restructure the program around cohesion and clear behavior instead of tiny components. 🔥 GitHub Repository: https://git.arjan.codes/2026/clean. 🎓 ArjanCodes Courses: https://www.arjancodes.com/courses. 💬 Join my Discord server: https://discord.arjan.codes. ⌨️ Keyboard I’m using: https://amzn.to/49YM97v. 🔖 Chapters: 0:00 Intro 0:52 What People Mean by “Clean Code” (And Where It Goes Wrong) 1:27 BEFORE: “Clean” Interface, Messy Reality 3:25 Hostinger Sponsored Integration 4:56 Step 1: Delete the Fake Abstraction and Container 5:54 Step 2: Introduce ReportConfig 10:17 Step 3: Make the Pipeline Explicit: Load → Summarize → Export 13:16 Step 4: Model the Result as a Cohesive Object 18:30 Step 5: Move Business Rules Into One Readable Place (is_valid) 21:31 Show the Final “After” Code (Your Version) 25:13 Reframe “Clean” as Cohesion, Not Smallness 25:52 Final Thoughts #arjancodes #softwaredesign #python

    Not rated yet
  • The Hidden Mechanism Behind Clean Python APIs (Descriptor Deep Dive)

    · 16 min

    🧱 Build software that lasts. Join the Software Design Mastery waiting list → https://arjan.codes/mastery. In this video, I explain what descriptors are, why attribute access in Python sometimes behaves in surprising ways, and how the descriptor rules determine whether an attribute comes from the class, the instance, or somewhere else entirely. Along the way, I’ll look at a few practical design ideas that show how descriptors can help you write cleaner, more reusable Python code. 🔥 GitHub Repository: https://git.arjan.codes/2026/descriptors. 🎓 ArjanCodes Courses: https://www.arjancodes.com/courses. 💬 Join my Discord server: https://discord.arjan.codes. ⌨️ Keyboard I’m using: https://amzn.to/49YM97v. 🔖 Chapters: 0:00 Intro 0:19 Immediately Show Code: The Smallest Descriptor You Can Watch 5:54 Build Your Own @property 8:57 Teaser Setup: The Precedence Rule (With Two Short Experiments) 11:06 Cool Design #1: Validated Fields (Write Code on Screen) 14:19 Cool Design #2: Lazy Cached Property (Write Code on Screen) 15:50 Final Thoughts #arjancodes #softwaredesign #python

    Not rated yet
  • Make Invalid States Impossible in Python

    · 14 min

    🧱 Build software that lasts. Join the Software Design Mastery waiting list → https://arjan.codes/mastery. In this video, I show how to use the Value Object pattern in Python to model prices, percentages, and email addresses properly. I’ll enforce invariants once, eliminate ambiguity (is 0.2 equal to 20%?), and make invalid states hard to represent, without adding unnecessary complexity. 🔥 GitHub Repository: https://git.arjan.codes/2026/value. 🎓 ArjanCodes Courses: https://www.arjancodes.com/courses. 💬 Join my Discord server: https://discord.arjan.codes. ⌨️ Keyboard I’m using: https://amzn.to/49YM97v. 🔖 Chapters: 0:00 Intro 1:44 Primitive Obsession (The Actual Problem) 2:30 The “Before” Example (Looks Fine, Isn’t) 3:10 What a Value Object Actually Is 3:47 Price as a Value Object (Behaves Like a Float) 5:39 Percentage as a Value Object (Kills Ambiguity) 7:27 Keep Business Logic as a Function 10:27 Second Example: EmailAddress as a Dataclass Value Object 12:03 Quick Mention: Pydantic 12:33 Why Enums Aren’t Value Objects 13:08 Final Thoughts #arjancodes #softwaredesign #python

    Not rated yet
  • Refactor a Messy FastAPI App Into Clean Architecture

    · 25 min

    🧱 Build software that lasts. Join the Software Design Mastery waiting list → https://arjan.codes/mastery. In this video, I refactor a FastAPI + SQLAlchemy example into a clean Ports & Adapters (Hexagonal Architecture) design. I separate domain logic from frameworks, introduce domain types and errors, define ports with Protocols, and implement adapters step by step. The result is pure, testable business logic that’s easier to maintain and evolve. 🔥 GitHub Repository: https://git.arjan.codes/2026/ports. 🎓 ArjanCodes Courses: https://www.arjancodes.com/courses. 💬 Join my Discord server: https://discord.arjan.codes. ⌨️ Keyboard I’m using: https://amzn.to/49YM97v. 🔖 Chapters: 0:00 Intro 1:23 What’s the Actual Problem? 3:11 Ports & Adapters in One Minute 4:25 The Demo Use Case (Keep It Tiny, but Real) 5:44 Step 1 — Create Domain Types (Stop Returning API-Shaped Dicts) 9:39 Step 2 — Introduce Domain Errors (No HTTP in the Domain) 12:54 Step 3 — Define the Port (What the Domain Needs) 14:39 Step 4 — Write the Use Case as Pure Logic 19:25 Step 5 — Create SQLAlchemy Adapter Implementing the Port 24:36 Step 6 — FastAPI Adapter Becomes Translation-Only 24:48 Final Thoughts #arjancodes #softwaredesign #python

    Not rated yet
  • You’ve Been Underusing Dataclasses (These Tricks Are Wild)

    · 27 min

    🧱 Build software that lasts. Join the Software Design Mastery waiting list → https://arjan.codes/mastery. In this video, I show you 7 powerful and lesser-known things you can do with dataclasses in Python. From automatic class registration and lightweight validation systems to cached derived values, context managers, CLI generation, and the often misunderstood `InitVar`. 🔥 GitHub Repository: https://git.arjan.codes/2026/dctricks. 🎓 ArjanCodes Courses: https://www.arjancodes.com/courses. 💬 Join my Discord server: https://discord.arjan.codes. ⌨️ Keyboard I’m using: https://amzn.to/49YM97v. 🔖 Chapters: 0:00 Introduction 1:23 1. Dataclass as a Singleton-like Factory 7:12 2. Dataclasses with Automatic Registration 12:17 3. Dataclass Validation System (Mini-Pydantic) 15:59 4. Generating SQL Schemas from Dataclasses (Simplified) 18:39 5. Dataclasses With Cached Properties 21:31 6. Dataclass as a Self-Building CLI Argument Parser 23:59 7. Dataclass as a Context Manager 25:43 Bonus: InitVar Constructor-Only Fields 27:23 Final Thoughts #arjancodes #softwaredesign #python

    Not rated yet
  • Stop Using Python Properties Like This

    · 17 min

    🧱 Build software that lasts. Join the Software Design Mastery waiting list → https://arjan.codes/mastery. In this video, I break down when something in Python should be a property and when it should be a method, and why that choice matters more than it looks. Using a simple example, I show how properties and methods communicate different promises about cost, safety, and behaviour. I’ll also look at why async properties are usually a design smell, and how to keep async work explicit without breaking clean object design. 🔥 GitHub Repository: https://git.arjan.codes/2026/props. 🎓 ArjanCodes Courses: https://www.arjancodes.com/courses. 💬 Join my Discord server: https://discord.arjan.codes. ⌨️ Keyboard I’m using: https://amzn.to/49YM97v. 🔖 Chapters: 0:00 Intro 1:17 Setup: One Example for the Whole Video (Synchronous Version) 2:29 Properties vs Methods 3:48 Derived State: A Perfect Use Case for Properties 6:14 Under the Hood: Why @property Works 6:59 Read-Only vs Writable Properties 8:58 When Setters Should Not Do I/O 10:29 Abstractions: Properties Are Part of the Contract 13:13 Question: Can a Property Be Async? 16:09 Final Thoughts #arjancodes #softwaredesign #python

    Not rated yet
  • CQRS in Python: Clean Reads, Clean Writes

    · 22 min

    💡 Check out MongoDB Atlas: https://www.mongodb.com/atlas. When your FastAPI list endpoint starts pulling full documents just to compute derived fields, it’s usually a sign your read and write models are drifting apart. In this video, I refactor a tickets API (FastAPI + MongoDB) using CQRS, explain projections and eventual consistency, and show when this architecture is worth the added complexity, and when it’s not. 🔥 GitHub Repository: https://git.arjan.codes/2026/cqrs. 🎓 ArjanCodes Courses: https://www.arjancodes.com/courses. 💬 Join my Discord server: https://discord.arjan.codes. ⌨️ Keyboard I’m using: https://amzn.to/49YM97v. 🔖 Chapters: 0:00 Intro 0:48 The Starting Point: A Perfectly Reasonable FastAPI App 3:53 Where the First Real Pain Shows Up 5:28 CQRS Explained 6:50 Example: Requirements Change 7:59 Separate Command Intent 12:36 Split Write Storage and Read Storage 13:00 Why MongoDB Fits Nicely 14:33 Step 4: Add a Projector 18:49 What Improves After the Refactor 20:39 When to Use CQRS 21:09 When Not to Use CQRS 21:44 Final Thoughts #arjancodes #softwaredesign #python

    Not rated yet
  • Stop Building Ugly APIs: Use the Fluent Interface Pattern

    · 17 min

    💡 Learn how to design great software in 7 steps: https://arjan.codes/designguide. In this video, I take a small but realistic Python animation API and refactor it step by step into a fluent interface that reads like a story instead of a configuration file. You’ll see a clear “before” version with clunky lists and hard-to-read setup, and then watch how the same behavior becomes more expressive and maintainable by introducing method chaining and domain-specific fluent methods. Along the way, I explain what the fluent interface pattern actually is, how it differs from the builder pattern, where you already use it in Python without realizing it, and when you should not use it. 🔥 GitHub Repository: https://git.arjan.codes/2026/fluent. 🎓 ArjanCodes Courses: https://www.arjancodes.com/courses. 💬 Join my Discord server: https://discord.arjan.codes. ⌨️ Keyboard I’m using: https://amzn.to/49YM97v. 🔖 Chapters: 0:00 Intro 0:58 What Is a Fluent Interface? (Quick Definition) 1:43 Real-Life Fluent Interfaces in Python (You Already Use Them) 2:13 The Domain: A Tiny Animation Engine 6:17 Before Version: Non-Fluent Animation Definition 7:30 The Engine: How play_scene Works 8:17 Refactor Step 1: Add an add() Method 9:47 Refactor Step 2: Turn add() into a Fluent API 11:20 Refactor Step 3: Domain-Specific Fluent Methods 14:49 When to Use Fluent Interfaces 15:18 When NOT to Use Fluent Interfaces 16:34 Final Thoughts #arjancodes #softwaredesign #python

    Not rated yet
  • 10 Python Features You’re Not Using (But Really Should)

    · 20 min

    💡 Learn how to design great software in 7 steps: https://arjan.codes/designguide. Python has a lot of powerful features hiding in plain sight, and many developers never really use them. In this video, you’ll see a series of small but impactful Python features that make real code cleaner, safer, and faster, illustrated with concrete before-and-after examples. If you’ve been writing Python for a while and want to level up how your code reads and behaves, this video will give you a few good “wait… Python can do that?” moments. 🔥 GitHub Repository: https://git.arjan.codes/2026/features. 🎓 ArjanCodes Courses: https://www.arjancodes.com/courses. 💬 Join my Discord server: https://discord.arjan.codes. ⌨️ Keyboard I’m using: https://amzn.to/49YM97v. 🔖 Chapters: 0:00 Intro 1:01 Why These Features Matter 1:27 1. functools.cache 2:32 2. typing.Protocol 5:46 3. dataclasses.replace 8:27 4. itertools.pairwise 9:36 5. Assignment Expressions (:=) 10:52 6. pathlib 12:40 7. contextlib.suppress 13:59 8. contextvars 16:44 9. match with guards 18:25 10. contextlib.ExitStack 20:13 Final Thoughts #arjancodes #softwaredesign #python

    Not rated yet
  • This Design Pattern Scares Me To Death

    · 29 min

    👉 Get real-time, search result data from Google, Youtube and more with SerpApi: https://serpapi.link/arjan-codes-jan-2025. Business rules have a nasty habit of spreading across your codebase: copied into APIs, reports, scripts, and slowly drifting out of sync. In this video, I start with a very real, very messy example of duplicated if-statements and show how it escalates into bugs and confusion. Then I refactor it step by step using the Specification Pattern, in a practical, Pythonic style that lets you compose rules, test them in isolation, and even turn your logic into data that can live in config files. 🔥 GitHub Repository: https://git.arjan.codes/2026/spec. 🎓 ArjanCodes Courses: https://www.arjancodes.com/courses. 💬 Join my Discord server: https://discord.arjan.codes. ⌨️ Keyboard I’m using: https://amzn.to/49YM97v. 🔖 Chapters: 0:00 Intro 0:49 What is the Specification Pattern 3:47 The Goal: Reusable, Composable Rules 4:21 Step 1: The Simplest Possible Predicate 13:56 Step 2: Make Defining Predicates Pleasant 16:48 Step 3: Generalize With Generics and Rule Factories 20:00 Step 4: A Single @Rule Decorator for All Rules 24:54 Step 5: Composing Rules in the User Domain 25:36 Step 6: Loading Rules From Config (Real Specification Power) 28:30 Final Thoughts #arjancodes #softwaredesign #python

    Not rated yet
  • 7 Things You Didn’t Know Dataclasses Could Do

    · 20 min

    💡 Learn how to design great software in 7 steps: https://arjan.codes/designguide. Dataclasses are often treated as nothing more than a shortcut for generating init methods, but there’s a lot more going on under the surface. In this video, I walk through several lesser-known dataclass features by gradually improving a simple example and showing how small changes can have a big impact on correctness, safety, and design. If you think you already know dataclasses, there’s a good chance you’ll learn something new here. 🔥 GitHub Repository: https://git.arjan.codes/2026/dataclass. 🎓 ArjanCodes Courses: https://www.arjancodes.com/courses. 💬 Join my Discord server: https://discord.arjan.codes. ⌨️ Keyboard I’m using: https://amzn.to/49YM97v. 🔖 Chapters: 0:00 Intro 0:54 1. A Safe Default Field 2:33 2. Derived Fields 4:54 3. Dataclasses Are Still Classes 6:27 4. Frozen Dataclasses 9:04 5. Slots, Ordering, and Keyword-only Arguments 11:20 6. Custom Constructors 13:55 7. Serialization Helpers 15:06 8. Abstract Dataclasses 19:53 Final Thoughts #arjancodes #softwaredesign #python

    Not rated yet
  • The Right Way to Use AI for Writing Maintainable Code

    · 27 min

    🧱 Build software that lasts. Join the Software Design Mastery waiting list → https://arjan.codes/mastery. AI can write code, but without solid software design, it quickly turns into an unmaintainable mess. In this video, I show why prompting alone isn’t enough and how thinking in terms of responsibilities, structure, and design allows you to truly direct AI coding agents to produce better, cleaner, and more scalable code. Using a real example, I walk through how design reduces complexity, improves AI interactions, and future-proofs your work. 🎓 ArjanCodes Courses: https://www.arjancodes.com/courses. 💬 Join my Discord server: https://discord.arjan.codes. ⌨️ Keyboard I’m using: https://amzn.to/49YM97v. 🔖 Chapters: 0:00 Intro 0:20 AI Assisted Development Issues 1:52 Fluent Interface Chat Walkthrough 25:07 SDM #arjancodes #softwaredesign #python

    Not rated yet