I’ve seen some variable declare in VB.net in several way like:
print('dim _Foo as string');
and print(‘dim m_Foo as string’); and print(‘dim foo as string’);
I will like to know what’s the standard for VB.net coding.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It all depends on the scope. In the case of:
That implies that m_Foo is a member of a class. This also implies the same thing:
It’s a matter of preference.
On the other hand, something like this:
might refer to a variable local to a given method. Some might even prefix it with a ‘l_’:
Declaring like these examples helps in determining scope when scanning code. Putting it all together, here’s a sample class showing a well-known naming convention (but not the only one):