2 ms·
Firstly, there are noise words in there. If there is no other kind of pricing in that context beside product pricing, "product" is useless. If the order of oper
by kazinator 11y ago
Firstly, there are noise words in there. If there is no other kind of pricing in that context beside product pricing, "product" is useless. If the order of operations is perfectly clear from the program flow, "After" is useless. "But" is a useless conjunction which doesn't add any information to "EmailSent".
This kind of thing can be broken into multiple Booelan variables:
bool pricingUpdated;
bool deliverySucceeded;
bool emailSent;
These can be initialized or assigned at various points in the flow. Then later we can have:
if (pricingUpdated && !deliverySucceeded && emailSent) ...
- snarfy 11y agoI totally agree, and this is a good example of how I would refactor that noise.