In Chapter 6, should If or Select Case be used?
In the previous lesson, I promised my answer to a question about whether to use an If ... ElseIf ... End If decision structure or a Select Case structure to calculate TaxDue.
"You will find that you get exactly the same answer with either code. So ... Assignment: Which One Should You Use?"
Here are my thoughts on the subject.
Fundamentally, it's a matter of your preferred programming style. The bottom line is getting the program to work correctly and efficiently and both styles do that. But my preferred programming style is Select Case. I find it easier to read and understand than the If structure. To my mind, it's easier to see exactly which statements are executed for every condition.
Frequent About Visual Basic contributor, Peter Zilahy Ingerman, PhD adds this reasoning, "Select Case makes writing multiple Or conditions simpler, so that if one begins by having a zillion separate Case statements, and one discovers that there are really only three or four actions, collapsing the Cases under a Select Case is a *whole* lot easier than rewriting the If-ElseIf-...-End structure."

