Sometimes your code fails, you change nothing, and the next run works perfectly. APIs time out. Networks hiccup. LLMs occasionally return almost JSON. Stuff happens. But if your code treats every failure as fatal, you end up with brittle systems that crash for no good reason. In my latest video, I walk through the Retry design pattern. I start with a deliberately flaky example so you can see the failures happen, then gradually make the code more resilient: simple retries, exponential backoff, a clean decorator-based approach, and finally a fallback strategy for cases where retrying the same thing no longer makes sense. Watch here: https://lnkd.in/eQYR6WPQ #python #cleancode #designpatterns #softwaredesign
ArjanCodes’ Post
More Relevant Posts
-
Sometimes your code fails, you change nothing, and the next run works perfectly. APIs time out. Networks hiccup. LLMs occasionally return almost JSON. Stuff happens. But if your code treats every failure as fatal, you end up with brittle systems that crash for no good reason. In my latest video, I walk through the Retry design pattern. I start with a deliberately flaky example so you can see the failures happen, then gradually make the code more resilient: simple retries, exponential backoff, a clean decorator-based approach, and finally a fallback strategy for cases where retrying the same thing no longer makes sense. Watch here: https://lnkd.in/ev4b3vpM #python #cleancode #designpatterns #softwaredesign
To view or add a comment, sign in
-
-
One tool to rule them all. Between pip, venv, pyenv, and poetry, Python environment management can feel like juggling too many rings of power. Enter uv, one tool that replaces them all. Create a project, add dependencies, run code, uv handles the virtual environment automatically. No more "which Python am I using?" confusion. And it's 10-100x faster than pip. The real magic? uvx runs tools in isolated, cached environments, no global installation needed. ⚠️ Running code from the internet means trusting the source. Verify package names and repo URLs. More at uv docs: https://cs.co/60467hxls #CiscoDevNet #DevTip #Python #NetworkAutomation #DevOps
To view or add a comment, sign in
-
Stop editing old code to add new features. 🛑 The Open/Closed Principle (the 'O' in SOLID) is the secret to a stress-free codebase. The goal: Open for extension, but closed for modification. In Python, we achieve this by using Abstract Base Classes (ABCs). Instead of a giant if-else block that breaks every time you add a new type, you define a blueprint. Why this wins: Zero Regressions: You don't touch the original, tested logic. Easy Scaling: Need a new feature? Just create a new class. Clean Code: Your core logic stays slim and readable. If you’re constantly "opening" old files to add new logic, it’s time to refactor! 🚀 #Python #CleanCode #SoftwareArchitecture #CodingTips
To view or add a comment, sign in
-
Async Processing Fixed a Major Stability Issue in Our Backend One API in our Python backend was doing too much in a single request: DB writes, notifications, and third-party calls — all synchronously. It worked… until traffic increased. What changed after moving non-critical tasks to async processing: • Faster API responses • Core flows stayed stable even when external services failed • Safe retries without impacting users • Easier scaling during peak traffic Lesson: Not everything belongs in a request–response cycle. Async design isn’t an optimization — it’s a reliability feature. #Python #BackendEngineering #AsyncProcessing #SystemDesign #ScalableSystems
To view or add a comment, sign in
-
2,800 lines of Python vs. zero. I tested both. I wanted a dev journal that writes itself. Claude Code already logs everything, I just needed to expose it. So I built an API. FastAPI, REST endpoints, proxy scripts. It worked. Then I ran an experiment: what if I put my research notes directly into a system prompt? No API. Just context about the data structures of your Claude Code config folder. Result: Same quality output. The finding: Context in prompts can replace explicit coded workflows, at least for POC stage. More research to follow on this concept. What I am calling Agent Native Architectures Link to article: https://lnkd.in/gT83y23b
To view or add a comment, sign in
-
-
📝 Project Spotlight: Note Saver Bot Built a Telegram bot using Python to save, search, and manage notes efficiently. Designed with a clean UI, statistics, and a contribution-friendly open-source structure. 🤖 Bot: @note_saver_bot 💻 GitHub: GitHub Issues / Repository #Python #Automation #TelegramBot #OpenSource #Projects #BackendDevelopment
To view or add a comment, sign in
-
Build AI agents in Python - the complete beginner's guide 🔄 Agent Loop - The core pattern 🔧 7 Built-in Tools - File ops, bash, web 🔌 MCP Native - Infinite extensibility 👥 Subagents - Task delegation ⚡ Hooks - Security & logging 🧠 Auto Memory - Context management Same SDK powering Claude Code. Now in your hands. Read the full guide: https://lnkd.in/dmibZSG3 #ClaudeCode #AI #Python #DevTools #AIAgents
To view or add a comment, sign in
-
-
While running ML experiments or building configurable apps, if you’ve ever struggled with configurations scattered across YAML files, CLI arguments, environment variables, and code, OmegaConf is a Python library that solves this by providing a powerful approach to hierarchical configuration management. It brings everything together into one unified, type-safe, and composable configuration system, making experiments more reproducible and applications easier to reason about. With smart merging, lazy interpolation, resolvers, and structured configs, you can catch errors early and scale complexity without losing control. https://lnkd.in/g7ZaafSt #ConfigurationManagement #OmegaConf #Python #MachineLearning #MLOps
To view or add a comment, sign in
-
-
Learn how to add interactive viewport controls to your HDAs using Python States with Mohamad Salame. Read and write parameters using keyboard and mouse input, work with multiparms and handles, and build right-click menus, selections, drawables, and more. https://lnkd.in/gmqUqpuw
To view or add a comment, sign in
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development
Great topic to explore. Had to deal with issues you discussed in a different language. Python seems better equipped to deal with such challenges.