Skip to main content
AmigoFish

DRY Often Makes Your Code Worse

From ArjanCodes · · 13 min

The player loads from YouTube only when you click. It uses YouTube's privacy-enhanced mode.

If the video does not play, the owner may have turned off embedding. Watch it on YouTube instead.

Watch on YouTube

Not rated yet

Description

🧱 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

Back to ArjanCodes · Report a problem