Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which is recommended: "static public" or "public static"

Tags:

c#

If you have a class member that is static and public. Would you write static public or public static? I know they are the same. But is there some recommendation / best practice for writing this?

like image 957
heijp06 Avatar asked Oct 27 '08 13:10

heijp06


2 Answers

"public static" is far more common, so you might want to go with that just to increase readability for programmers who never stumbled upon "static public".

like image 76
Firas Assaad Avatar answered Oct 22 '22 04:10

Firas Assaad


see this question

If you download the Microsoft StyleCop Visual Studio addin, it can validate your source code against the rules Microsoft use. It likes the access modifier to come first.

like image 36
Mark Heath Avatar answered Oct 22 '22 04:10

Mark Heath