Quantcast
Channel: Visual C# forum
Viewing all articles
Browse latest Browse all 31927

naming conventions

$
0
0

Hello,

When choosing an instance name for a class, I usually use camel case like this

class Employee

{...}

private void MyFunction()

{

  Employee employee=new Employee();

}

But, if I want to declare a global variable for that class, the instance name would be the same as the class name, because public instances should be PascalCased...

class MyClass()

{

  Employee Employee=new Employee();

.

.

}

And that's quite confusing. Maybe the root problem is structural here, as far as I'm trying to use a 'Global instance of a class', something ugly. Call me lazy.

I know this is a basic question, but I cannot seem to find a convention to deal with this. I don't want to use underscores _ as they are not recommended for .net afaik. What do you recommend ?

Thanks in advance !

Roger


Viewing all articles
Browse latest Browse all 31927

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>