3 ms·
Is that view not subjective though? Might someone think that if/else is simpler?
by fortylove 5y ago
Is that view not subjective though? Might someone think that if/else is simpler?
- qayxc 5y agoDepends entirely on the metric used. Cyclomatic complexity would put if/else behind polymorphism while using lines of code and depth of inheritance would favour the if/else way. That's the crux with software - there's not always an objectively better solution in terms readability/comprehensibility and some metrics that try to capture these qualities are inherently at odds with each other.