Avoid hidden control flows

Here’s an hot take (I think) to end this beautiful Sunday: avoid using hidden control flows in your applications. I’m referring to throwing exceptions, specifically, here. When we throw an exception, we lose control on the application flow.

It’s also something that can’t really be ignored. The caller needs to wrap interactions to methods and functions that throws exceptions if they don’t really need to do anything with the exception. Without that their own flow would be impacted and interrupted unnecessarily.

A more sensible solution is to do something like Go and Rust does: return the error. Let the caller decide what to do with the returned values instead of being forced to handle everything with awful try/catch blocks.

Maybe this could be a nice topic to blog about or submit to a meetup/conference?… 🤷‍♂️