Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does "o" mean as a variable prefix?

Tags:

c#

naming

in oCn? What is the rule?

using(SqlConnection oCn = new SqlConnection(
        "Server=(local);Database=Pubs;User ID=TestUser1;Password=foo1;")) {
        oCn.Open();
        ...
    }

I found that type of naming in this article http://msdn.microsoft.com/en-us/magazine/cc163799.aspx

like image 723
johnny Avatar asked Feb 23 '11 20:02

johnny


People also ask

What is variable prefix?

The idea of variable prefixes They are used to tell the developer what kind of variable he is using. The first prefix for example is m_ and the conclusion is this variable is a member. When I learned programming we had to give the developer more information in case of a member.

What does M_ mean in C#?

As stated in the other answers, m_ prefix is used to indicate that a variable is a class member. This is different from Hungarian notation because it doesn't indicate the type of the variable but its context.

Why some variables start with _?

Many programmers use it to differentiate private variables - so instance variables will typically have an underscore prepended to the name. This prevents confusion with local variables.

Can a variable name end with a digit?

A variable name cannot start with a digit. A variable name can only contain alpha-numeric characters and underscores ( a-z, A-Z , 0-9 , and _ ) Variable names are case-sensitive (age, Age and AGE are three different variables) There is no limit on the length of the variable name.


1 Answers

An entirely obsolete way of saying that "Cn" is an *o*bject.

like image 150
Humberto Avatar answered Sep 21 '22 16:09

Humberto