Java Child / The Four Moves Everything Is Built From
Giving A Chunk Of Work A Name So It Returns
The fourth move is naming, and it is the one that lets programs grow larger than a single mind can hold.
Take a group of steps that achieve one identifiable thing and give it a name. Now you can ask for that thing without restating the steps. This is not merely a saving of effort. It changes what you are able to think about, because a named chunk becomes a single item in your head rather than a dozen. Complexity is not defeated by cleverness, it is defeated by packaging, and naming is the packaging. A program you cannot hold in your mind can still be worked on if it is made of pieces you can.
The quality of a name matters more than beginners expect. A name that describes what the chunk achieves lets you reason about it without opening it. A name that describes how it works forces you to open it every time, which defeats the purpose. When you struggle to name something, that difficulty is usually telling you the chunk does more than one thing, and that it wants to be two chunks with two honest names.
Here is the observation worth carrying away. Every program you will ever read is these four moves combined: order, choice, repetition and naming. A system with millions of instructions has no fifth ingredient waiting to ambush you. It is simply these four, nested deeply and arranged with care. When a large piece of work looks impenetrable, the way in is always to find which of the four you are standing inside, and then to do the same thing one level down.