News:

SMF - Just Installed!

Main Menu

Would You Approve Python Code That Hides Every Error?

Started by RossS, November 06, 2026, 04:44:59 AM

Previous topic - Next topic

RossS

Here's a Python coding practice that deserves more debate: catching every exception just to keep an application running.

Consider a reporting API that fails to retrieve customer orders. Instead of returning an error, the code catches the exception and returns an empty list.

The dashboard loads normally, but now it shows zero orders.

No warning. No obvious failure. Just incorrect information.

I think that's potentially more dangerous than an application displaying an error, especially when businesses depend on those reports for decisions.

Of course, there are situations where fallback values make sense. But shouldn't developers distinguish between genuinely empty data and data that couldn't be retrieved?

This is also something worth discussing when businesses hire python developers. Knowing Django, FastAPI, or Flask is useful, but understanding error handling, logging, and failure recovery matters just as much.

I'd rather work with a developer who explains why an operation failed than someone who makes every error disappear.

What's your approach in production Python applications? Do you prefer failing explicitly or returning fallback values to keep the application running?

Visit: https://spaculus.com/services/hire-python-developers