I am anti "foo"


I am anti "foo". Why? Because "foo" typically confuses rather than clarifies.

My preference: Use *realistic* values and identifiers that convey real-world use cases.

Useful examples convey realistic scenarios.
Some will say "What about irrelevant data in a test or API call?"

1. Leave optional fields empty.
2. If irrelevant data is required, I use a *realistic* value and comment it.

const user = {
email: "c@h.com"
eyeColor: "brown" // ignored by test, but required
}
Examples that use "foo" only show me syntax. 👎

Examples that use realistic data help me understand the problem being solved. Realistic examples help me understand real-world use cases. 👍

View original on X