Please explain the statement...
Posted on 2012-03-14
Please demonstrate, add explanation, preferably add some sample codes to illustrate the following statements. I am trying to fully understand the point the author of A, B, and C below is making. Each of these statements most likely true but I am not quite getting them:
A) Never use form or class level variable scope (or access level) unless it is needed.
B) In this code, if the variable strShowMessage is declared as String then that is incorrect since the Messagebox.show does not return String but a DialogResult type:
If strShowMessage = Windows.Forms.DialogResult.Yes Then
C) “textbook text changed event handler that assigns the textbook content to a local variable” is indeed useless.