← Posts

I removed try/catch from most of our Flutter codebase. The code got more predictable, not more fragile.

· First published on LinkedIn ↗

A Dart signature returning Either<Failure, User>: failure as a value, not a surprise

The problem: scattered try/catch hides which functions can actually fail, until production tells you the hard way.

What we did: rebuilt the data and domain layers around fpdart. Every risky call returns an Either, so failure is a value, not a surprise. Fully test-driven, since side effects are now explicit.

The result: fewer crash reports, faster PR reviews.

Functional programming isn’t academic. In production Flutter, it’s a correctness feature.

Would you introduce fpdart and Either into an existing codebase, or only start with it greenfield?