4 ms·
Funny this ends up here. I was asking earlier on twitter today about whether there was a C# convention for naming private variables. Seems that it is indeed _v
by mgrouchy 17y ago
Funny this ends up here. I was asking earlier on twitter today about whether there was a C# convention for naming private variables.
Seems that it is indeed _variablename , while I don't know if I like it, it would seem that it is more common then I thought and specifically mentioned in this article.
- cema 17y agoThere is also a trend to use variablename_ instead, a subtle change, but feels a bit better.
- jgrahamc 17y agoBecause Perl's OO stuff is screwed up and has now private/public/protected distinction I used a _ and __ convention for protected and private member variables. e.g. $object->{this_is_public} $object->{this_is_protected_} $object->{this_is_private__}
- snprbob86 17y agoThe official .NET class design guidelines only cover public interface: http://msdn.microsoft.com/en-us/library/czefa0ke(VS.71).aspx http://msdn.microsoft.com/en-us/library/czefa0ke(VS.71).aspx _privates is common, but in my experience at the largest of all C# shops, the explicit this.privates is more common. I use Resharper to enforce this style, but then again I use Resharper for every damn feature that wonderful wonderful magically tool provides.