DEV Community

Discussion on: Avoiding Exceptions in ASP.NET Core

Collapse
 
akashkava profile image
Akash Kava

Isn't exception itself Railway Oriented Programming? I guess that pattern was originally meant to be for "C" like programming where exception wasn't the language feature.

If you look at how the control flows, exception path is a separate path created by language to follow everything correctly.

Multiple nested Try/Catch has huge performance cost. Not only this, too much branching is debugging nightmare, and it slows down CPU instruction caching.

And a biggest issue is, if someone eats up exception and re throws wrong one, you could spend days trying to find bug.