Most C# style guides seem to favor explicit over implicit. For example, StyleCop will pretty much always complain if an object of any type (class, interface, field, property, method, etc.) is declared without an access modifier.
My personal preference would also be to always include the private
keyword, because it makes it easier to see at a glance that the member is private. If there's no access modifier my brain sort of has to go through a two-step process where it first needs to identify that there's no access modifier, and then remember that no modifier = private
.
What makes it more complicated is the fact that for instance on classes, no access modifier = internal
. I understand why fields/properties/methods and classes/interfaces need to differ in this regard, but I dislike the fact that the lack of an access modifier changes its meaning depending on the object type.
But all of this is of course highly debatable.