Let's get started with the following set of questions:
Methods with more than four
if statements (
else()) pose a number of related problems. First, due to the verbosity of Apex, numerous
if statements will necessarily mean longer methods. Second, because each statement creates another logical path through the method, each also represents at least one additional test case to be written. The fewer the number of logical paths through your code, the simpler it is to understand, test, and refactor. Unfortunately, sometimes the business logic we are calculating requires a number of conditionals. For instance, calculating tax ...