3 ms·
Lot of personal preferences masquerading as objective truths in this article. My personal preference for C#: private fields are camelCased and are always prefi
by balfirevic 6y ago
Lot of personal preferences masquerading as objective truths in this article.
My personal preference for C#: private fields are camelCased and are always prefixed with this on access (disambiguating field from parameter access); methods and properties are not prefixed. I find this gives a nice balance between code noise and explicitness.
Same principle could be applied to method access (since C# has local methods and static imports) and I would happily concede that it is a sane approach - but I don't find the code noise it produces is worth it.
If I join an existing project that consistently uses some other approach (even if it's an old-school underscore-prefixed fields approach) that's OK too.