I'll Be Backend
Principles

Tell, Don't Ask: Move the Decision Inward

Tell, Don't Ask means you tell an object what to do instead of asking for its data, deciding outside and writing the result back. When callers make an object's decisions, every rule change has to be found in every caller. These lessons move the decision into the object that owns the data, one safe refactoring at a time.

Pick your language

When to use it

Use it when

Callers read an object's fields to make a decision, then write the result back into it.

Skip it when

The caller only reads data to show it, like a receipt line, or the object is a plain data record such as a request body.

Spot it by

A getter and a setter on the same object, used in one method of another class.