Why is this article even remotely applicable here, Dr. Frank? Not only does this technique factor away the recursive part of the algorithm from the transformative, but it improves performance at the same time. Any time you can abstract to a simpler requirement (that is more testable) and gain performance, this is like finding a silver dollar at the beach. You should take it and be thankful.
I think an awful lot of OO programmers see "visitor pattern" and immediately their body clenches because they've been given warnings over and over about how "multiple dispatch is dangerous and confusing." And when it's used in specialized code instead of generic code, that's true. But when it's used to separate business logic from algorithmic implementation, it's nearly always a net win.
I think an awful lot of OO programmers see "visitor pattern" and immediately their body clenches because they've been given warnings over and over about how "multiple dispatch is dangerous and confusing." And when it's used in specialized code instead of generic code, that's true. But when it's used to separate business logic from algorithmic implementation, it's nearly always a net win.