Sub topic 1
What Counts as a Habit
Prerequisites
Assume you know the difference between an everyday routine and a goal. No background in psychology or programming is required.
What Counts as a Habit
A habit is a behavior that becomes easier to start in a repeated context. A goal-directed action is chosen because you are thinking about its result. For example, you may decide to study because you want to pass an exam.
A habit can begin as a goal-directed action. After enough repetition, the same situation can trigger the behavior with little deliberate thought. You still can choose differently, but the familiar action feels more available.
The Three Parts of the Habit Loop
The habit loop has three parts:
- Cue: a signal that starts the behavior.
- Routine: the behavior you perform.
- Reward: the useful or pleasant result that follows.
For example, finishing morning coffee may cue a walk. The walk is the routine. Fresh air and a short break are the reward.
You can record a loop as three named fields:
from dataclasses import dataclass
@dataclass
class HabitLoop:
cue: str
routine: str
reward: str
def describe(self) -> str:
return f"When {self.cue}, I {self.routine}, so that I get {self.reward}."
loop = HabitLoop("I finish coffee", "I walk outside", "fresh air")
print(loop.describe())Cues: What Triggers the Behavior
A cue comes before the routine. It may be part of the environment, your body, or your social setting.
Recognizing Common Kinds of Cues
| Cue type | Example |
|---|---|
| Time | It is 3 p.m. |
| Location | You enter the kitchen. |
| Preceding action | You finish brushing your teeth. |
| Emotional state | You feel stressed. |
| Other people | A colleague offers a snack. |
Look for what reliably happens immediately before the behavior. A vague cue such as “when I have time” is harder to use than “after I close my laptop at 5 p.m.”
Routines: The Behavior Itself
The routine is the observable action, not the reason for it. “Relax” is a result or feeling. “Read two pages” is a routine. Make the routine specific enough that another person could tell whether you performed it.
Exercise
Identify the cue, routine, and reward in this example: “After lunch, I check messages because it gives me a short break.”
Show answer
Cue: finishing lunch. Routine: checking messages. Reward: a short break.