I learned some time ago about Decision Trees and Decision tables. I feel that Decision Tables can help with conditional If-Then-Else statements. In particular, I feel that Decision Tables have no side-effects, for example, if you didn't notice that you need one more "else if" statement.
But I am not sure how I can implement it. Arrays? Database Tables? Does anyone even use Decision Tables in their code, nowadays?
I would highly recommend chapter 18 of Code Complete.
You could also check this post What Are Table Driven Methods
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With