Home
Do you follow naming conventions for your Boolean Property?
  v2.0 Posted at 30/01/2020 10:19 AM by Liam Elliott
Boolean Properties must be prefixed by a verb. Verbs like "Supports", "Allow", "Accept", "Use" should be valid. Also properties like "Visible", "Available" should be accepted (maybe not). Here is how we name Boolean columns in SQL databases.

public bool Enable { get; set; }
public bool Invoice { get; set; }

Bad Example

public bool Enabled { get; set; }
public bool IsInvoiceSent { get; set; }

Good Example - Naming Convention for Boolean Property

We have a program called SSW Code Auditor to check for this rule.​

Related rules

    Do you feel this rule needs an update?

    If you want to be notified when this rule is updated, please enter your email address:

    Comments: