Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the correct naming notation for classes, functions, variables etc in c#?

I'm a web developer with no formal computing background behind me, I've been writing code now some years now, but every time I need to create a new class / function / variable, I spend about two minutes just deciding on a name and then how to type it.

For instance, if I write a function to sum up a bunch of numbers. Should I call it

Sum()
GetSum()
getSum()
get_sum()
AddNumbersReturnTotal()

I know there is a right way to do this, and a link to a good definitive source is all I ask :D

Closed as a duplicate of c# Coding standard / Best practices

like image 434
Ian G Avatar asked Dec 17 '22 10:12

Ian G


1 Answers

You're looking for StyleCop.

like image 162
chills42 Avatar answered Dec 24 '22 02:12

chills42