Complex Decision Code_Best Approach
Posted: Mon Aug 04, 2008 12:49 pm
Hi,
I have a function that must work through several layers of decision points. Right now implemented with nested If...Else blocks.
Many times the decision arrived at must implement the same code with just a change or two to variable values and such.
And it is getting difficult to follow.
My question is....is it acceptable coding practice to place function calls inside the If...Else blocks? This, in my mind would make the code more readable and easier to follow the logic. However, do I lose anything in all the function calls?
The If...Else blocks would remain, I would just be able to call different functions with different parameters to do the work.
What is the best approach when dealing with a high degree of complexity of decision points?
Thank You,
Mike
I have a function that must work through several layers of decision points. Right now implemented with nested If...Else blocks.
Many times the decision arrived at must implement the same code with just a change or two to variable values and such.
And it is getting difficult to follow.
My question is....is it acceptable coding practice to place function calls inside the If...Else blocks? This, in my mind would make the code more readable and easier to follow the logic. However, do I lose anything in all the function calls?
The If...Else blocks would remain, I would just be able to call different functions with different parameters to do the work.
What is the best approach when dealing with a high degree of complexity of decision points?
Thank You,
Mike