3 ms·
Solving the issue of having two different ways of drawing shapes by having two different classes of shapes and special logic to construct the right one seems li
by contravariant 3y ago
Solving the issue of having two different ways of drawing shapes by having two different classes of shapes and special logic to construct the right one seems like a bad idea.
Seems to me that what you actually want is an algebraic data type and 2 different plot functions. Visitor patterns are a neater way to achieve that.
- viraptor 3y ago> seems like a bad idea. "Seems like a bad idea" seems like a bad way to make software engineering decisions. Define what you're losing / gaining, how it impacts readability, does it simplify future development, etc.
- contravariant 3y agoWouldn't one normally require that kind of analysis before embracing some design pattern, rather than dismissing it? I'm just saying what my prior is, I'm not saying I won't change my mind, but you seem to suggesting I should require less evidence to accept the option I'm least sure about. Which, you know, seems like a bad idea.