2 ms·
This technique improves readability, improves abstraction, improves testability, and improves performance. Please don't confuse your superstitions or local cul
by KirinDave 8y ago
This technique improves readability, improves abstraction, improves testability, and improves performance.
Please don't confuse your superstitions or local culture's distaste for properly researched architecture for a more general sense of code quality. Simply saying, "I saw the word visitor and got mad," not only is disrespectful to the author, but it's disrespectful to your entire profession.
- fenwick67 8y agoYou and I weren't there so without details it's hard to say whether it's sensible or over-engineered
- KirinDave 8y agoGiven the fact that this is a combination of well-known techniques, trivially offers performance benefits, and makes the transformation part of the code testable in isolation from the process or recursion, it's a smart first pass. I think most experienced OO engineers could sit down and write this in one pass. Calling it overengineered is pretty ridiculous IMO. "Over-engineered" doesn't mean, "Because software training is often inadequate someone might encounter this for the first time in industry rather than in school."
- phyzome 8y agoVisitor pattern definitely does not automatically improve readability or clarity. (In the general case! Summing values would be an exception.) In fact, I'd see it as a performance/readability tradeoff in any language where recursive tree processing is ergonomic. Not even knowing the language involved, there's really not much to say.
- KirinDave 8y agoI'm not referring to the Visitor pattern in Abstract, I'm referring to the specific solution the author of the article we are discussing employed. There is no such thing as a pattern that always increases clarity. That's not what patterns are for, so that's unsurprising. It's the case though that this specific application has pretty much only benefits.