Is it just a good practice to fully qualify an object reference or does it
Neither. It makes the lines longer. It is actually only used at compilation
stage as it is a 'language feature' and not something you will see in the
resulting binary file. Therefore there is absolutely no performance
difference.
For instance, if I have a Combo box, cmbMyCombo, on a form, which is better?
1. cmbMyCombo.SelectedIndex = 0
or
2. Me.cmbMyCombo.SelectedIndex = 0
Neither is better. For the 1st one I'd be in doubt if it is a class or a
local variable. How can I tell that from the name?
For the 2nd line I'd say it's useless to write it out fully because it
doesn't make me much smarter except that I know now that it belongs to the
class.
In the old days with MFC, Microsoft had something they called hungarien
notation. For variables you should specify "m_" infront of the variable.
This tells that the variable is a member of the class.
It's quite commonly used on other languages like java too and these days
comes in various forms: _var1, m_var1 or var1_.
Personally I use something like m_nValue meaning an integer value belonging
to the class. If it'd be a local variable I'd use nValue instead.
-- John