Home
Do you follow naming conventions for your Boolean Property?
  v1.0 Posted at 26/04/2018 7:38 AM by Tiago Araujo
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 ReadOnly Property Enable As Boolean Get Return true End Get End Property
Public ReadOnly Property Invoice As Boolean Get Return m_Invoice End Get End Property

Bad Example

Public ReadOnly Property Enabled As Boolean Get Return true End Get End Property
Public ReadOnly Property IsInvoiceSent As Boolean Get return m_IsInvoiceSent End
Get End Property

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:

    Note: Social Media login for Yotpo is not working in IE or Safari, please use Chrome. We are waiting for Yotpo to fix it.