This question already has an answer here:
I wanted to know if there are some default standards for writing c# code. By default I mean may be something officially from Microsoft, or any other organization.
I am looking for something where I can find answers to questions like following:
should I do this:
public void DoSomeThing(int id)
{
//method body
}
or:
public void DoSomeThing(int id) {
//method body
}
should I do this:
Car car = new Car();
or:
Car car =
new Car();
should I declare my variable in camel or pascal case, should I declare input parameters in method signature camel or pascal, should the global variable be prefixed with underscore or internal variable be prefixed with underscore ...
all these kind of questions ... any suggestions?
The actual issue is, I work on two projects for two different companies. and both have exactly opposite standards. I want to convince either of those and my self that such and such is the right way, because of such and such reason.
I know there is no one right way, but still any defaults documented from any leader organization would help. Thanks.