4 ms·
> It's actually the same amount of code in either case. Which cases are you comparing? I was just saying M+N ≠ M×N, and that solutions that forces M×N are bog
by loup-vaillant 13y ago
> It's actually the same amount of code in either case.
Which cases are you comparing? I was just saying M+N ≠ M×N, and that solutions that forces M×N are bogus.
> If this is possible (which is very problem-dependent), then it's just as easily solved with inheritance.
True. Then again, you don't need the visitor pattern.
- quacker 13y agoI was just saying M+N ≠ M×N, and that solutions that forces M×N are bogus. Agreed. I was clarifying that converting your code to use visitors does not force an order of magnitude increase in the amount of code. If you start out with O(M+N) without visitors, you'll still have O(M+N) code after converting to visitors. Although, visitors are generally better appreciated when managing O(M*N) code than when managing O(M+N) code.
- loup-vaillant 13y agoYep.