How long can it take?
coding style Elegant ways to handle if(if else) else
- coding style Elegant ways to handle if(if else) else
It is really hard to tell without knowing how the different checks interact. Rigorous refactoring might be in order. Creating a topology of objects that execute the correct block depending on their type, also a strategy pattern or state pattern might do the trick.
- 26/07/2010 · To avoid ambiguity I’ll explain how I’m using a couple of terms in this article: • statement branching: any construct that alters the sequence of statement execution within the global or functional scope. These include if, else, switch, for and while statements. • micro-branching
- Try to avoid using boolean values comparison with "==". It will work for you in many cases but it is not a right way to perform a condition check. It will work for you in many cases but it is not a right way to perform a condition check.