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)
那么你对此有何看法?
两者都用。它使您的代码更具可读性:
if (IsPrintable) Print()
if (HasDocument) Documents[0].Name = 'New Doc'
ETC。