4 ms·
Depends entirely on the metric used. Cyclomatic complexity would put if/else behind polymorphism while using lines of code and depth of inheritance would favou
by qayxc 5y ago
Depends 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.