Avoid Code Repetition in Condition Statements
- by Ethosik
I have been programming for over 15 years now. I consider myself a very good programmer, but I understand (like all of us) there are things that I need to work on. One of these things is code repetition when dealing with conditions. I will give a generic sample:
if(condition1)
{
//perform some logic
if(condition2)
{
…