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.

ArjanCodes
50.3K views β’ Oct 31, 2025

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
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) Related Trending Topics
LIVE TRENDSRelated trending topics. Click any trend to explore more videos.