A Capital Question of Style
I was just looking at some of the style notes in VS2019 and found something odd enough I thought I'd ask folks about it.
I name any class level variables with the prefix 'm', which is lower . This only serves to differentiate form level versus local variables for me, but it is a habit I have long held. 'm' stands for "marsupial", of course.
VS style notes have no problem with this naming convention...most of the time. However, if I declare a variabe WithEvents, then they DO have a problem with it. Therefore:
Code:
Private mErrors As Something 'This is fine.
Private WithEvents mErrors As Something 'This is not fine
What the style notes say is "These words must begin with upper case characters: mErrors"
That seems really wrong to me. It's still a variable. It will be used like any other member variable with the exception of the fact that it might (should) appear in a Handles clause.
What is the reasoning behind that style note?
Re: A Capital Question of Style
When a variable is defined using WithEvents, it becomes a non-field member.
By default ( Tools > Options > Text Editor > Basic > Code Style > Naming), non-field members require pascal case and will give you a suggestion to fix it when it isn't.
Re: A Capital Question of Style
Just another example of Capitalism run amok. Thanks [current or recent US President that you vehemently disagree with]!
Re: A Capital Question of Style
Quote:
Originally Posted by
OptionBase1
Just another example of Capitalism run amok. Thanks [current or recent US President that you vehemently disagree with]!
:thumb::thumb::thumb:
That's an awesome answer.
Re: A Capital Question of Style
Quote:
Originally Posted by
OptionBase1
Just another example of Capitalism run amok. Thanks [current or recent US President that you vehemently disagree with]!
:):):):)