|
-
May 11th, 2022, 11:14 AM
#1
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?
My usual boring signature: Nothing
 
-
May 11th, 2022, 11:39 AM
#2
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.
-
May 11th, 2022, 11:47 AM
#3
Re: A Capital Question of Style
Just another example of Capitalism run amok. Thanks [current or recent US President that you vehemently disagree with]!
-
May 11th, 2022, 02:18 PM
#4
Re: A Capital Question of Style
My usual boring signature: Nothing
 
-
May 12th, 2022, 08:14 AM
#5
Re: A Capital Question of Style
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|