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
Arjan Egges’ 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/eQYR6WPQ #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
-
📝 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
-
🚀 Turbocharge your RAG pipelines with SymRank. If you are building RAG systems, you know that every millisecond counts during the retrieval step. We've just upgraded SymRank to v0.2.0, and the performance gains are substantial. SymRank is a high-performance cosine similarity ranking library that replaces standard NumPy/scikit-learn calls with a blazing-fast Rust backend. What’s new in v0.2.0? • Matrix API: A new optimized path for 2D NumPy arrays that delivers up to 5x faster re-ranking compared to standard Python baselines. • Python 3.14 Ready: Fully tested and compatible with the latest Python release. • Smart Dispatch: Automatically selects serial or parallel execution based on your workload. • Memory Efficient: Native batching support to keep your footprint low. SymRank is designed to be a drop-in upgrade for your vector search and ranking workflows. Benchmarks (10k vectors): ⏱️ SymRank: ~1.8ms Check it out on GitHub (link in first comment) and let us know what you think! 👇 #RAG #VectorSearch #Python #Rust #MachineLearning #LLM #ReRanking
To view or add a comment, sign in
-
-
🚀 Day 8 of #100DaysOfCode ✅ Solved LeetCode 1108 – Defanging an IP Address 🔐 A simple problem, but a strong reminder that: 👉 Strong fundamentals build great developers. 💡 Key takeaways: ✔ String manipulation ✔ Clean and readable logic ✔ Thinking within constraints One problem a day. Consistency > motivation. 💪 👇 How would you solve this — using replace() or a loop? #LeetCode #Python #DSA #ProblemSolving #CodingJourney #LearningInPublic #SoftwareDeveloper #TechLife
To view or add a comment, sign in
-
-
Tuesday Debug Diary | First Open-Source PR Spent hours chasing a “hang.” Turned out to be an asyncio + keep_alive design clash. Bug: Browser(keep_alive=True) + asyncio.run() → program never exits. Why it broke keep_alive=True keeps background asyncio tasks alive (watchdogs, CDP handlers, websockets). asyncio.run() expects a clean event loop. Mismatch = loop never closes. Not a deadlock. A lifecycle issue. Context Python/asyncio isn’t my strongest language I picked this up purely to understand how the system works under the hood. Lesson If background tasks are intentional → use one long-lived event loop. Multiple asyncio.run() calls = trouble.First OSS PR. Not merged. Real learning happened. #OpenSource #Python #Debugging #LearningInPublic #FirstPR
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
-
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
Perfect timing! Looking forward to it.