Reducing Excessive Function Arguments: A Practical Guide

Tired of passing five arguments to every function? In this video, I clean up the argument overload and provide solutions to streamline your code. Learn how to design great software in 7 steps: https://arjan.codes/designguide.

Reducing Excessive Function Arguments: A Practical Guide
ArjanCodes
50.3K views β€’ Oct 31, 2025
Reducing Excessive Function Arguments: A Practical Guide

About this video

πŸ’‘ Learn how to design great software in 7 steps: https://arjan.codes/designguide.

Tired of passing five arguments to every function? In this video, I clean up a realistic Python codebase using the Context Object Pattern. You’ll see how to go from messy, repetitive function signatures to a cleaner and more maintainable design. We’ll introduce context objects, explore how they help reduce parameter bloat, discuss the trade-offs (like increased coupling), and show how to use Protocols to keep things decoupled and testable.

πŸ”₯ GitHub Repository: https://git.arjan.codes/2025/context.

πŸŽ“ ArjanCodes Courses: https://www.arjancodes.com/courses.

πŸ’¬ Join my Discord server: https://discord.arjan.codes

πŸ”– Chapters:
0:00 Intro
1:07 The Before Version: Too Many Arguments
3:43 Introducing the Context Object Pattern
9:35 But Wait β€” Aren't We Adding a Bunch of Coupling?
10:56 Making a Distinction Between High-Level vs Low-Level Code
13:33 High-Level Convenience, Low-Level Clarity
15:07 Using Abstraction
17:22 When Should You Use Context Objects?
18:51 Final Thoughts

#arjancodes #softwaredesign #python

Tags and Topics

Browse our collection to discover more content in these categories.

Video Information

Views

50.3K

Likes

2.1K

Duration

19:45

Published

Oct 31, 2025

User Reviews

4.7
(10)
Rate:

Related Trending Topics

LIVE TRENDS

Related trending topics. Click any trend to explore more videos.