Cosmin Vladutu
1 min readApr 28, 2023

--

Yes, for months I agree, you could do a enumeration, but think for example about the VAT. Here in Romania, the VAT is different for food product, drinks with sugar, and all other products. If I am not mistaken, there are 2-3 numbers for this tax. For this for example I would introduce constants and not enumeration. In the end there are constant numbers not an enumeration of numbers.

For the example that you asked about the reset of the stack trace, imagine the next scenario: You work on an SDK and someone else is using it. You don't want to throw all the details when a problem appears, you want to obfuscate it and maybe give an exception from an "upper layer". The "real source" of your problem can be logged, saved, do some magic with it, but the caller not to be informed about it, since he shouldn't know "your" specifics.

--

--

Cosmin Vladutu
Cosmin Vladutu

Written by Cosmin Vladutu

Software Engineer | Azure & .NET Full Stack Developer | Leader

Responses (1)