Sometimes I\'m writing ugly if-else statements in C# 3.5; I\'m aware of some different approaches to simplifying that with table-driven development, class hierarchy, anonimous m
Simple. Take the body of the if and make a method out of it.
This works because most if statements are of the form:
if (condition): action()
In other cases, more specifically :
if (condition1): if (condition2): action()
simplify to:
if (condition1 && condition2): action()