布尔属性的命名约定

Wii*_*axx 1 boolean properties naming-conventions

我正在努力解决Is-Has-之间的布尔值前缀。
因为有时Has-Is-更有意义

样品:

bool IsPrintable
bool IsChecked

bool HasDocument
bool HasPermission
Run Code Online (Sandbox Code Playgroud)

那么你对此有何看法?

Rya*_*yan 5

两者都用。它使您的代码更具可读性:

if (IsPrintable) Print()

if (HasDocument) Documents[0].Name = 'New Doc'

ETC。