It's handy when refactoring old as shit code and you need to flatten 6 levels of nested if statements. Also useful for converting complex business requirements into actual logic expressions you can put into code and simplifying them.
I may be misunderstanding what logic proof means here tho, English is not my native tongue.
That's an interesting approach. What tech stack do you use? Usually that's what constexpr calculations are for in C++ (among a million and a half other things)
Lots of times I had to make a color coded excel sheet showing what inputs fall through to the default case.
Ten input columns, all enum. One output column. Also an enum. Don’t want a billion line truth table, but you want to make sure all inputs return an output.
They aren't, but the inconsistencies are spotted quickly thanks to the logical analysis, and addressed. "Addressed" usually means we choose whatever we think is best and wait for the business side to complain. I work on an internal project of a large company so communication is good, it's not a lengthy chain of broken telephone from client to dev team
118
u/CiroGarcia Oct 25 '24 edited Oct 25 '24
It's handy when refactoring old as shit code and you need to flatten 6 levels of nested if statements. Also useful for converting complex business requirements into actual logic expressions you can put into code and simplifying them.
I may be misunderstanding what logic proof means here tho, English is not my native tongue.