1. Why doesn’t code have a Save/Load button like games do
Tommy thinks for a couple of seconds and writes to Alex. And the first thing he sends is not even a question, but an indignant observation, the very thing he had just figured out for himself half a minute earlier:
“Listen, I don’t get one thing. In any normal game, what do I do before a hard boss? I save. I went into the fight, died — loaded the save, as if I had never died. One button. But with code I sit there and make folders by hand, like a caveman. Why doesn’t code have the same Save/Load?”
Alex is clearly pleased with the question.
“And you’re right to have figured that out yourself. Because that’s exactly the point. See, what is a save in a game? It’s a fixed state you can return to at any moment. You remember when it was good — and then you can roll back to that ‘good.’”
He takes the thought further:
“And now the main thing. Code has exactly the same thing: states. The project was working. Then you added something — another state. Then you broke it — a third one. Then you fixed it — a fourth. Working on code is not one point, it’s a chain of states, one after another. And with the successful ones you want to be able to return, just like to a save before the boss. Your final2 folders are exactly an attempt to make saves. A clumsy one, but still an attempt.”
“Wait,” Tommy interrupts, because something clicks in his head. “So I’m not an idiot who makes folders for no reason? I was actually trying to make saves for code, just by hand and the hard way?”
“Exactly.” Alex nods. “Your need is absolutely right. You sensed with your gut that code goes through states and that you need to be able to return to the good ones. That’s the instinct of a good developer. The only thing that was crooked was your method — folders. The idea itself is gold.”
“So it’s not me that needs fixing, it’s the tool,” Tommy says slowly. And he hears how it sounds: not “I’m a dumb beginner,” but “I picked a stupid tool.” The difference is huge.
“Now you’ve got it,” Alex replies. “And tools are easy enough to come by.”
2. Three troubles with folder copies
“Okay, the need is normal — I already knew that.” Tommy leans back, pleased with himself. “But what’s specifically wrong with folders? I mean, I made a dozen of them, they’re just sitting there. So what, a mess. I’ll sort it out in five minutes if needed.”
“Three things, and each one bit you today,” Alex says, counting them off on his fingers. “One: confusion. A week later you don’t remember which version is the latest — today you opened final2 and found old stuff. Two: you can’t see what changed. You look at final and final2 and no matter how hard you try, you can’t say how they differ — the name tells you nothing. Three: clutter. Ten full copies of the project eat up space and clutter your screen.”
And he picks a metaphor so it really sinks in:
“Imagine that in a game you didn’t save with a button, but instead every time copied the entire disk. The whole game, with all the files, into a new pile. Before the boss — a disk copy. After the fight — another copy. A month later you have a hundred disk copies piled in the corner, and try to figure out which one contains that very save. Nonsense, right? But with code folders you are doing exactly that.”
Tommy winces — he recognized himself far too accurately.
“So what I need is not ‘arrange the folders even more neatly.’ I need a completely different mechanism. A normal history of states, not a stack of copies.”
“You said it yourself. And the good news: such a mechanism exists, and not just one. You’ll get acquainted with the easiest one today.”
3. Break the task into safe steps
“Alex, I’m ready to listen to any lecture of yours right now,” Tommy interrupts. “Just not about 2048. My eye is already twitching because of it. Today I reviewed the code in different folders about twenty times. I even had to play them to remember what exactly the game does in a particular folder.”
“Want something more complicated?” Alex asks, delighted.
“No, thanks. Let’s do something more interesting. Oh, I want Tetris,” he says. “But it’s scarier, right? Falling pieces, rotations, speed, and lines being cleared. If 2048 created such chaos, then Tetris is twice as bad. Better not break it.”
“Here’s where you slow down.” Alex catches the moment. “Since you’re afraid to break it all at once, let’s not build it all at once. Big things aren’t built in one go. They are broken into steps. See how Tetris fits into steps.”
He lays out the Tetris build in order:
1. first, just the well and one falling piece
2. then — piece rotations
3. then — filled lines disappear, scoring happens
4. then — acceleration, effects, sound, themes
“See what we’ve got?” Alex continues. “Each finished step is a working state. A natural save point. Built the well with the falling piece, checked that it works — there’s your save. Moved on to the next step, messed up the rotations — rolled back to the previous working one. And the risk is always small: you don’t lose all of Tetris, just one step.”
“But why not just do everything at once, and then roll back if something goes wrong?” Tommy guesses where Alex is going and tries to wriggle out of it.
“Good question, and here’s the catch.” Alex doesn’t brush it off. “If you dumped everything in one chunk and it broke, you’d roll back the whole chunk — the good and the bad together. Half a day of work down the drain. But if you went in small steps, you roll back only the last failed step, and everything you’ve built before it stays intact. Decomposition and rollback are not different things; they’re a team: small steps make rollback cheap. The smaller the step, the less you lose when you go back.”
“This is your ‘normal history of states’ in action,” he adds. “The technique itself is called decomposition — breaking a big task into small safe chunks. It’s useful on its own, and especially with an AI agent: it’s much easier for it to do one clear step well than to build all of Tetris from start to finish at once. It will almost certainly mangle a big task somewhere, while a small one — it’ll pull off cleanly.”
Tommy can already see the future spec: not “make me Tetris,” but a staircase of steps, and on each step you can stand still and not fall down. But he wants more.
“Decomposition is clear and cool. But I still need the button itself. The one that will replace my folder zoo. So that I roll back — and the crooked edits are gone as if they never happened.”
“You’ll get your button,” Alex promises. “But first I’ll show you how the pros do it. So you understand where your button even fits in.”
GO TO FULL VERSION