4 ms·
Considering that defining functions by sets of pattern matched clauses is a thing in more and more languages, it's rarely known for some values of "rarely".
by 082349872349872 3y ago
Considering that defining functions by sets of pattern matched clauses is a thing in more and more languages, it's rarely known for some values of "rarely".
- rramadass 3y agoThe article is not just about using decision tables at the code level but as a design methodology right from requirements stage.
- AdieuToLogic 3y agoA key difference between pattern matching and decision tables is the intrinsic flexibility of the latter at the expense of simplicity the former provides. Whereas pattern matching most often encodes branching statically by what is explicitly encoded, decision tables allow for runtime branching based on workflow context. Both have their strengths and weaknesses and, IMHO, the choice as to which to use is situational. Another related technique which employs a bit of both of these approaches is the Visitor pattern[0]. 0 - https://en.wikipedia.org/wiki/Visitor_pattern https://en.wikipedia.org/wiki/Visitor_pattern