Underscore in Public Class Module Member

Warns about public class members with an underscore in their names.


The public interface of any class module can be implemented by any other class module; if the public interface contains names with underscores, other classes cannot implement it - the code will not compile. Avoid underscores; prefer PascalCase names.

Default severity


Inspection type



This example should trigger a result

MyModule (ClassModule)
'@Interface Public Sub Do_Something() ' underscore in name makes the interface non-implementable. End Sub

This example should NOT trigger a result

MyModule (ClassModule)
'@Interface Public Sub DoSomething() ' PascalCase identifiers are never a problem. End Sub

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