Me or not Me?

chris_asa

Active member
Joined
Sep 4, 2009
Messages
26
Location
Switzerland
Programming Experience
10+
my old VBA habits make me use Me.Somecontrol.xxxxx because this made VBA go faster.
Is Me.Somecontrol a useful/harmfull VB.NET syntax, or simply a pointless historical affectation ?

regards Chris
 
I copied your "other" question to new thread.

VBA is a scripting language, each time code is executed it has to be resolved from source code, so qualifying objects better means the engine doesn't have to do as much work finding them.

VB is a compiled language, during compilation all code references are resolved, at runtime only the low level instructions are executed and expressions evaluated. How you qualify objects does not matter for VB since they have already been resolved when code is executing, both notations produces the same IL code. In my opinion it makes the code more readable to use the Me reference in VB since you don't have think or search for it to see where is belongs when reading the code. Using Me reference may also get you better 'dot' results by intellisense to let you write code faster.
 
The script/compiled discussion is blindingly obvious once you've seen it on the screen - thanks for putting it on the screen for me to see.
I guess I'll continue using Me since I still play with VBA from time to time and it does no harm in VB.NET

regards Chris
 
Back
Top