Why Your Code Isn’t Pythonic (And How to Fix It)
💡 Learn how to design great software in 7 steps: https://arjan.codes/designguide. What does it actually mean to write Pythonic code? In this video, we answer that question by taking a small, messy script and refactoring it step by step using the core principles of idiomatic Python. Along the way, you’ll learn how to think like a Pythonista: using functions instead of unnecessary classes, leveraging dataclasses, writing readable control flow, embracing tools like pathlib and logging, and applying the Zen of Python in practice. 🛍️ Check out ArjanCodes merch: https://shop.arjancodes.com. 🔥 GitHub Repository: https://git.arjan.codes/2025/pythonic. 🎓 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:18 What does Pythonic mean? 2:08 Before 3:13 Step 1 – Prefer Functions Over Classes 4:32 Step 2 – Use Context Managers 6:42 Step 3 – Add Type Annotations 10:46 Step 4 – Favor EAFP Over LBYL 12:06 Step 5 – Use Dataclasses for Structured Data 17:09 Step 6 – Centralize File Paths and Use 19:19 Step 7: Rely on Python's strengths 23:10 Step 8 – Add Logging Instead of Print 24:10 Step 9 – Add a Main Function 25:56 Final Thoughts #arjancodes #softwaredesign #python

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

Python Properties vs Methods: The Contract You Didn’t Know You Were Making

From Consumers to Builders: Turning 200 of our Team into Agent Creators in 2 Weeks

7 Things You Didn’t Know Dataclasses Could Do

The Ultimate Guide to Writing Functions

Python Sucks And I LOVE It | Prime Reacts

10 Python Tips That Separate Juniors From Seniors

I Hacked This Temu Router. What I Found Should Be Illegal.

5 Signs of an Inexperienced Self-Taught Developer (and how to fix)

Python Decorators - Visually Explained

Why You Should Think Twice Before Using Returns in Python

The Builder Pattern in Python: Finally Explained!

Python 3.14: The NEW T-strings are Awesome

He honestly thinks we can afford this

Python Has Serious Problems, But I Use It Anyway

What Most Python Developers Miss About Generators

From Spaghetti Code to Clean Python

This is probably the biggest misconception about Python

Microsoft's Greed is Finally Backfiring

