I Really HATE Brittle Python Functions | Issue #46


Hi there,

Ever had a function work most of the time but randomly break when you least expect it? That’s a sign your code is brittle. And brittle code means debugging nightmares.

The good news? You can avoid this!

In this week’s video, I break down:

🔹 Why checking types at runtime is a bad idea

🔹 The best way to handle value constraints without making a mess

🔹 Whether your function should return None or raise an exception

🔹 Why failing fast is the best approach to writing reliable Python

And if you deal with translations in your app, I’ve got a great solution to prevent hardcoded string chaos.

Happy coding and enjoy the video!

Cheers,

Arjan

# News

We Moved to a New Office… and Now I’m in Prison 🔒

Sounds dramatic? Well… it is. But also, completely true.

At the end of last year, my team and I decided it was time for a change. Our old office was way too big for what we needed and felt a bit isolated. Plus, no good coffee spots nearby, and that’s a deal-breaker. ☕❌

So, we moved. And the new place? It’s an old prison. Yeah. Literal jail. Not exactly what you’d expect for a "warm and welcoming" workspace, but it’s pretty cool and full of character. And possibly a few ghosts. 👻

The best part? We’re much closer to the center of Utrecht now. Less commuting, more opportunities for post-work fun, and probably fewer escape attempts (hopefully).

Stay tuned—I can’t wait to show you around!

♟️ Beating LinkedIn Queens with Python

You’ve seen them—those viral 8-queens puzzles on LinkedIn, sparking debates and wrong answers everywhere. But why guess when Python can solve it for you? 🏆

Rodrigo from Mathspp breaks it down in a brilliant blog post, using backtracking to crack the N-Queens problem efficiently. This isn’t just about chess—it’s the same logic behind scheduling, optimization, and other real-world challenges! 🧠💡 Check it out here.

# Community

If your online presence is growing—whether through content creation, open-source projects, or tech work—how do you keep your personal info safe? 🤔

A recent Discord discussion tackled some BIG questions:

  • How do you protect your identity online? 🕵️‍♂️
  • Should you separate work and personal accounts?
  • Is using the same nickname across projects a risk?
  • What do employment contracts say about your side projects?

The insights were eye-opening! Want to know what the community (and I) had to say? Join the conversation on Discord and make sure you’re not leaving yourself exposed. 🚀


Do you enjoy my content on YouTube and would you like to dive in deeper? Check out my online courses below. They've helped thousands of developers take the next step in their careers.

🚀 The Mindset Online Course Series

The goal of this series is to help junior developers grow their skills to become senior developers faster.

💥 Other Courses

💡 If you’re part of a development team at a company, I offer special packages for companies that give your team the tools to consistently write high-quality code and dramatically increase your team's productivity.

Unsubscribe | Send by ArjanCodes

Jan van Eijklaan 2-4, Bilthoven, UT 3723 BC

The Friday Loop

Every Friday, you'll get a recap of the most important and exciting Python and coding news. The Friday Loop also keeps everyone posted on new ArjanCodes courses and any limited offers coming up.

Read more from The Friday Loop

Hi there, Ever looked at your old code and felt secondhand embarrassment? Yeah, me too. Keeping your code simple and maintainable is an art. In today’s video, I break down 10 essential tips that will help you write cleaner, more efficient Python code. 🚀 Some key takeaways: 🛑 Stop overengineering—simple solutions are often the best. ✂️ Cut the copy-paste habit—DRY code is maintainable code. 🧹 Refactor before your code turns into a horror movie. Happy coding! 🐍 Cheers, Arjan # News How Do...

Hi there, Have you ever hesitated before hitting git merge or git rebase because… well, who actually understands Git? 🤯 Good news! In this week’s video, I walk through a real-world FastAPI project and show exactly how to merge, fast-forward, and rebase—step by step. No fluff, just practical Git skills you’ll actually use. Plus, I’m sharing some advanced Git tricks to make your workflow smoother. Happy coding and enjoy the video! Cheers, Arjan # News Build TUI Apps with Python’s Textual Ever...

Hi there, You’ve probably heard the phrase: “Coupling is bad.” But what if I told you that coupling is actually necessary? The real issue isn’t that your code has coupling—it’s that some types of coupling are worse than others. 🚨 In this week’s video, I dive into three real-world examples of bad coupling and show you how to refactor them into better designs. We’ll tackle: Global coupling – Why global variables cause headaches and how to avoid them Content coupling – When modules dig too deep...