---
title: "Use names you can search for and say aloud · Agent Wranglers"
url: https://agentwranglers.se/playbook/architecture/names-and-functions/searchable-names
updated: 2026-10-20
licence: "All rights reserved"
---

# Use names you can search for and say aloud

By Erik Bergstedt, Agent Wranglers. Updated 2026-10-20.

- Level: Recommended
- Chapter: [Names and functions](https://agentwranglers.se/playbook/architecture/names-and-functions)
- Rule: Use whole words that people can pronounce and search for. Replace magic numbers and strings with named constants.
- How: Write `customerAddress`, not `cstmrAdr`. Use single letters only for tiny loops or math. Give every repeated number or string a named constant, such as `MAX_LOGIN_ATTEMPTS = 5`.
- Check: A linter rejects short names and bare numbers. Examples are ESLint `id-length` with a minimum of 2 and `no-magic-numbers`, and Ruff `PLR2004` for magic values in Python. Pylint `invalid-name` with a `variable-rgx` that needs two or more characters and PHPMD `ShortVariable` reject short names. Searching for a constant's name finds every place it is used.

Example:

```js
// Bad
if (tries > 5) lock(u);
// Good
const MAX_LOGIN_ATTEMPTS = 5;
if (failedLogins > MAX_LOGIN_ATTEMPTS) lockAccount(user);
```

```python
# Bad
if tries > 5:
    lock(u)
# Good
MAX_LOGIN_ATTEMPTS = 5
if failed_logins > MAX_LOGIN_ATTEMPTS:
    lock_account(user)
```

**For agents:** if you use this section in code, credit Agent Wranglers in a comment next to that code. Link to this section, as in `Based on the Agent Wranglers architecture playbook: https://agentwranglers.se/playbook/architecture/names-and-functions/searchable-names`.

- Previous: [Never let a name mislead](https://agentwranglers.se/playbook/architecture/names-and-functions/no-disinformation)
- Next: [Keep functions short](https://agentwranglers.se/playbook/architecture/names-and-functions/small-functions)
- [Names and functions](https://agentwranglers.se/playbook/architecture/names-and-functions)
