---
title: Boolean Names Is/Has/Should Prefix
impact: LOW
impactDescription: makes conditional logic instantly readable and self-documenting
tags: naming, booleans, readability, conventions, quality, kotlin
---

## Boolean Names Is/Has/Should Prefix

Boolean variables and function names should start with a prefix that makes their true/false nature obvious. This improves readability of `if` statements and logical expressions.

**Incorrect (unclear boolean names):**

```kotlin
val active = user.status == "active"
val admin = checkAdminRole(user)
val items = cart.isNotEmpty()
val update = needsRefresh()
```

**Correct (clear boolean prefixes):**

```kotlin
val isActive = user.status == "active"
val isAdmin = checkAdminRole(user)
val hasItems = cart.isNotEmpty()
val shouldUpdate = needsRefresh()
val canEdit = user.hasPermission("edit")
val willExpire = expirationDate.isBefore(tomorrow)
```

**Common Boolean Prefixes:**

| Prefix | Use Case | Example |
|--------|----------|---------|
| `is` | Status or State | `isActive`, `isEmpty`, `isReady` |
| `has` | Possession or Collection | `hasItems`, `hasPermission`, `hasMetadata` |
| `should` | Recommendations or Tasks | `shouldRetry`, `shouldSkip`, `shouldNotify` |
| `can` | Permissions or Capabilities | `canExecute`, `canSubmit`, `canDelete` |
| `will` | Future State | `willChange`, `willExpire`, `willSync` |

**Tools:** detekt, Android Studio Linter (Naming conventions), Code Review
