3 ms·
I completely agree with you for the case when you say that avoiding an if brings you to code duplication. In that case from my point of view it’s a big NO. But
by tigershark 8y ago
I completely agree with you for the case when you say that avoiding an if brings you to code duplication. In that case from my point of view it’s a big NO.
But in all the other cases, if you are using an OO language, there are always better tools than ‘if statements’.
If you are using functional programming with if expressions instead of if statements then the ‘best balance’ moves a bit in favour of the ifs or a lot towards exhaustive pattern matching.
On the whole I would say that I agree with the article discussed here, but with some caveats.