[ACCEPTED]-Which is recommended: "static public" or "public static-c#
"public static" is far more common, so you 3 might want to go with that just to increase 2 readability for programmers who never stumbled 1 upon "static public".
see this question
If you download the Microsoft StyleCop Visual 3 Studio addin, it can validate your source 2 code against the rules Microsoft use. It 1 likes the access modifier to come first.
When nothing else matters, go with consistency. In 3 this case the rest of the world uses public static
, so 2 I'd go with that too just to avoid unnecessary 1 surprise in those reading your code.
I personally would go with public static 6 because it's more important that it's public 5 than that it's static.
And check this: http://checkstyle.sourceforge.net/config_modifier.html
As 4 well as this: http://java.sun.com/docs/books/jls/second_edition/html/classes.doc.html (These two links are for 3 Java, but the concept is the same)
Short 2 version: "public static" is recommended 1 and is far more common.
More Related questions
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.