FlareStart
HomeNewsHow ToSources
FlareStart

Where developers start their day. All the tech news & tutorials that matter, in one place.

Quick Links

  • Home
  • News
  • Tutorials
  • Sources
  • Privacy Policy

Connect

© 2026 FlareStart. All rights reserved.

Back to articles
ArticleTools

The Value Object Pattern: The Most Underrated Design Tool in Python

via ArjanCodesArjanCodes12h ago

🧱 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:3

Watch on ArjanCodes

Opens in a new tab

Watch on YouTube
4 views

Related Articles

Sometimes you have to re-evaluate decisions you made 5 years (or 5 months!) ago in your codebase
Article

Sometimes you have to re-evaluate decisions you made 5 years (or 5 months!) ago in your codebase

freeCodeCamp.org • 16h ago

How to use the .add() method in Three.js
Article

How to use the .add() method in Three.js

freeCodeCamp.org • 1d ago

I wrote some code by hand, it was rough...
Article

I wrote some code by hand, it was rough...

Theo • 2d ago

Can you guess what this is? Wrong answers only!
Article

Can you guess what this is? Wrong answers only!

freeCodeCamp.org • 4d ago

How to handle being thrown into an existing codebase and being expected to figure it out
Article

How to handle being thrown into an existing codebase and being expected to figure it out

freeCodeCamp.org • 5d ago

Discover More Articles