“Select Case” or “IF Else” which is preferable and why?

Team members can comment to explain their views.

Advertisements

One thought on ““Select Case” or “IF Else” which is preferable and why?

  1. It seems that the compiler is better in optimizing a switch-statement than an if-statement.

    The compiler doesn’t know if the order of evaluating the if-statements is important to you, and can’t perform any optimizations there. You could be calling methods in the if-statements, influencing variables. With the switch-statement it knows that all clauses can be evaluated at the same time and can put them in whatever order is most efficient.

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s