|
|
|
|
|
by annymsMthd
6141 days ago
|
|
I definately know some of the inner workings of.Net, such as using StringBuilder compared to string concatenation. Some of the things I need to know is what is an acceptible name for a variable based on its scope. For instance currently to describe a private variable belonging to a class I will prefix it with an underscore. Is there a universal way of denoting varibles by scope? |
|
- For private class fields, I use an underscore with camelcase, starting with a lowercase letter, e.g.:
private static int _id = 12345;
- For public class fields, properties, methods, etc. I use camelcase, starting with an uppercase letter, e.g.:
public double Determinant() ...
- For method parameters, I use camelcase, starting with a lowercase letter, e.g.:
public void Foo(int bar, ref string helloThere)
I think this is also the style that Microsoft uses internally, and it makes it easy to see where your variables came from.