Hungarian Notation

Flags identifiers that use [Systems] Hungarian Notation prefixes.

Reasoning

Systems Hungarian (encoding data types in variable names) stemmed from a misunderstanding of what its inventor meant when they described that prefixes identified the "kind" of variable in a naming scheme dubbed Apps Hungarian. Modern naming conventions in all programming languages heavily discourage the use of Systems Hungarian prefixes.

Default severity

Suggestion

Inspection type

NamingAndConventionsIssues

Examples

This example should trigger a result

MyModule (StandardModule)
Public Sub DoSomething() Dim bFoo As Boolean, blnFoo As Boolean Dim intBar As Long ' which is correct? the int or the Long? End Sub Private Function fnlngGetFoo() As Long fnlngGetFoo = 42 End Function

This example should NOT trigger a result

MyModule (StandardModule)
Public Sub DoSomething() Dim foo As Boolean, isFoo As Boolean Dim bar As long End Sub Private Function GetFoo() As Long GetFoo = 42 End Function

Rubberduck.CodeAnalysis.Inspections.Concrete.HungarianNotationInspection.cs (Prerelease-v2.5.9.6289)