Rename Field

Removes smells
Symptom

A class field whose name is ambiguous (`name` on a Position class — role name or person?), shadowed by language keywords, or describes implementation type rather than domain role.

Goal

Field names match the domain role they play; readers don't need to inspect usage to know what a field means.

Before the refactoring

class Position {
name; // role name? or person's name?
hiringManager;
}
console.log(position.name); // ambiguous

After the refactoring

class Position {
title;
hiringManager;
}
console.log(position.title); // clearly the role
Example source: Illustrative example written for this site, not a quotation from any source.
Pressure

Every reader/writer of the class must figure out what the field means from context; bugs surface when readers assume the wrong meaning.

Tradeoff

Same drift as Rename Variable, amplified across the field's read/write surface and any persistence shadows (DB columns, JSON schemas, APIs).

Relief

Stronger encapsulation; future readers read the class definition and immediately understand its shape.

Trap

Renaming a field without updating the persistence shadow — DB columns, JSON schema, API responses still use the old name and break serialization/deserialization silently.