#Managing code cleanliness for nested decision trees

2 messages · Page 1 of 1 (latest)

strong beacon
#

Not specific to rust more of a general software development question: I have a decision tree that's 4 layers deep with branching factors ranging from 2-4. Currently I have a bunch of nested match statements mixed with if-else. I've extrapolated most of the program logic out to helper functions so it's as clean as possible, but it's still a mess to look at. Is there any practices to help manage code complexity in this type of situation?

dapper iris
#

I sometimes use a tuple of all the decision variables and match on it