3 ms·
If statements are not an abstraction though. But I do actually try to minimize them, to the extent that's reasonably possible. And will especially try to minim
by Beltalowda 5y ago
If statements are not an abstraction though.
But I do actually try to minimize them, to the extent that's reasonably possible. And will especially try to minimize "else if" and "else", when reasonable, since I find it increases the cognitive load when reading something.
Interfaces are a better comparison. Interfaces are very useful and I've often used them with great success, but with generally see if other simpler "more direct" solutions work before using interfaces, as those solutions typically less abstract and easier to understand. I've definitely seen some code with "interface overuse" where it could be quite hard to find out what "foo.InterfaceMethod()" actually really does.
- djur 5y agoIf statements are an abstraction over conditional jumps.