c# - Disadvantages to using lots of if statements -
apart code readability, why bad use lots of if statements?
if have lot of if statements 1 after other, switch case statement more useful. @ least has fixed response time each possible inupt not need fall through if statements.
a lot of if (and else) statement indicates
a) violation of single responsibility principle
b) need refactor out strategy design pattern
Comments
Post a Comment