Considering that my program has to perform a certain set of actions based on a condition, and this set of actions is described in 20-30 lines of code, should I keep it within the conditional (an if block, part of the Main function) or is it best practice to group it inside a function (called PerformTheAction() for example)?
I am interested in learning which is best practice regarding readability, design and performance, if it matters (I think it does in c++ at least).