The Algorithm That Wasn’t the Point
Situation
Tianjing was supposed to have her regular Friday coding class.
Then, unexpectedly, I was told that she could not start.
At first, I assumed she might be unhappy or angry.
I didn't know what had happened.
Later, I learned that she had been caught playing a game, and a difficult conversation with her parents had followed. When Tianjing finally accepted my Slack Huddle, she was crying — badly.
I was shocked.
I was moved immediately.
So I didn't talk about homework.
I didn't talk about discipline.
I didn't ask her to explain herself.
I simply stayed there.
Turning Point
Within less than a minute, Tianjing started coding.
She returned to our Chinese-chess project.
And then she faced the hardest piece of code she had written so far:
isPieceBetween.
A rook can move horizontally or vertically.
But it cannot jump over another piece.
So Tianjing had to teach the computer what “between” means.
Not the starting square.
Not the destination.
Every square in between.
Four directions.
Four different cases.
And suddenly, a crying teenager was thinking about coordinates, loops, boundaries, and pieces on a chessboard.
Emergence
The code was not the important thing.
The important thing was that she came back to herself through the code.
She didn't need to become happy first.
She didn't need to stop crying first.
She didn't need to solve everything happening around her first.
She simply had somewhere to go.
And something meaningful to do.
The class became a small bridge from emotion back to agency.
Learning
Perhaps sometimes we misunderstand what learning is for.
We think:
child → class → knowledge
But sometimes the direction is different:
child → difficulty → learning → agency
The programming problem gives the mind something solid to hold.
The child begins thinking again.
And thinking can sometimes become a way of finding one's footing.
I cannot know exactly what happened inside Tianjing that afternoon.
But I know what I saw:
She arrived crying.
She stayed.
She coded.
And eventually she wrote the hardest algorithm of her life.
Theme
Learning as refuge.
Not escape from life.
A way to return to it.
What Is Possible?
Can a difficult algorithm become a place where a young person regains confidence?
How Does It Happen?
Not through a lecture.
Sometimes through one small problem worth solving.
Why Does It Matter?
Because the thing we call “coding” may sometimes be doing something much larger than teaching code.
The algorithm was isPieceBetween.
But that afternoon, what she was really learning was something harder to name:
“Even when I am hurting, I can still think.
I can still make something.
I can still move forward.”