--

Hi, Erik.

Understand, but even according to your link it is written that instantiating exception is cheap (compare to throwing it, and even that adds not bigger impact, if you doing the regular throw/catch, not like 1000 per second).

Then the second case regarding models. I can understand that and I see that it can be useful too, and maybe I would also consider using them. However, there are different practices and approaches (and different ages of codebases you started working in). And I would not say that some of them are ideal. Regarding handling exceptions with error codes. This is one of the practices too.

So from my perspective, it is more a matter of the taste as long as you are aware of drawbacks and handles them respectively.

--

--

Michael Spitsin
Michael Spitsin

Written by Michael Spitsin

Love being creative to solve some problems with an simple and elegant ways

Responses (1)