3 ms·
(Note: I don't think an aversion to `if` statements is the motivation behind the blog post here. Seems more an exploration into the minimum feature set needed i
by the_gastropod 4y ago
(Note: I don't think an aversion to `if` statements is the motivation behind the blog post here. Seems more an exploration into the minimum feature set needed in Python)
If people are removing if statements at the cost of readability, I think they're probably bad candidates for replacement. The reason for removing if statements is (especially when deeply nested), they're very hard to reason about and test. Untangling these things (e.g., polymorphism) is intended to improve readability / understandability / ability to be changed. Everything in software engineering is a compromise—sometimes a simple if statement is a lot clearer than introducing polymorphism unnecessarily. Each case will vary.