rubberduck-vba / Rubberduck

Every programmer needs a rubberduck. COM add-in for the VBA & VB6 IDE (VBE).

Home Page:https://rubberduckvba.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Consider specific Annotations for UserForms

AlpsDevABE opened this issue · comments

What
When using Code Inspection for userforms the following items come up:

  • Consider renaming Control lblPassword
  • Consider renaming procedure cmdOk_Click

Ignoring these instances at Module level will apply '@IgnoreModule HungarianNotation
Which will suppress any internal variable from marking in the Code.

Why
I understand that Systems HungarianNotaion is bad however in user forms you often have multiple control elements representing as single object such as a Label, TextBox and maybe even a button or two. It becomes a nightmare to manage when there is such a bad mix of Data and Logic together and that is just the nature of userforms.

I would recommend something like '@IgnoreUserForm HungarianNotation which would suppress any references to things like lblPassword txtPassword if Password is a Form Control along with any functions that occur for that control without excluding the inspection for Real Code.

Example

'@IgnoreUserForm HungarianNotation 
' This code should not trigger the inspection:
Private Sub cmdCancel_Click()
  ' But this code should
  Dim strPotatoes as String
  strPotatoes = "Why systems hungarian, ugh!!"
End Sub