Recursion

She decided to try a different approach.

"Have you heard of Russian nesting dolls before," Hillary asked.

"Yeah, sure. Those weird wood things that have faces and weird" -- he pronounced it 'werd' -- " colors painted on them."

"Yes, yes exactly. Now consider how each one contains the other."

"Yeah. Alright."

"And at the end there's gotta be one that doesn't contain another, right?"

"Right, right."

"Now applying that to code, one function, or process contains a call to itself. At some point however there has to be a condition that evaluates to true, and that makes the code stop instead of calling itself again."

"Oh yeah. Okay, I see."

"So if you look at this simple counting function, it keeps incrementing" -- she froze as Bretons face expressed a look of horror and confusion -- " Incrementing just means adding a set number to it, in this case 1." she quickly added before Bret could ask another dumb question.

"So you see that this function has a check on whether or not i, the argument that was passed into it, is equal to or greater than 10. Once that condition is met, the function returns i, which will now be…"

Hillary paused as if Breton would know the answer.

"Wouldn't it be j?" He asked stupidly.

Hillary had such fortitude, such professionalism, such courage, that she only let out a sigh.

"It would be 10. Cmon Bret."

"Oh? Oh yeah, yeah no I'm starting to get it, I really am," he lied through his teeth. "Every time the process goes through, it calls a different function that returns… Another call… To some other thing… In the code."

Hillary had had enough. She already spent the last 3 hours tutoring this miscreant after school. She had her own troubles, her own tests to study for and assignments to finish. And here she was, charitably tutoring some idiot.

"No. It was 10, of course it would be 10. The code stops when i equals 10. Have you been paying attention at all?" She said exasperated at his laziness.

"Okay, alright. Lemme try again."

"So, we have this code that calls itself. This code can call itself because it has a condition that after some iterations, after some tries, will resolve to true. At that point, it will not call itself, as it usually does, but instead return a value. This is, recursion."

"Okay. Alright. I think I get it.”

So given that, in the problem set, the problem with your code is that...”

“Hmm. Do I have to declare another function to be called upon?”

Of course he didn't get it.

"Look Bret, it has been a really long night, and I can't help but feel that you are not trying your best. I'm really trying to help you, but I need you to work hard, and try to pay attention. I know that you can do better if you applied yourself, if you put your heart and dedication into it." she said, finally giving him the hard truths society had shielded from him. "I'm giving it my all, and I would appreciate some, even a little effort, on your part."

"Haha, alright Hillary," he said dismissively. "Anyway I gotta go, thanks."

“Oh, okay. When it’s convenient for you, you get to give up. You can choose when and for how long I waste my time. No, I’m not gonna let you quit like this. I don't know what you do on your extracurriculars, but I can promise you, this stuff is more important. If you quit now, I’ll have to consider if I can continue tutoring you."

"More important? More important than what? Than which college you go to? Than which industry you end up working for? Than what your fucking salary is in 10 years? Are you kidding me. You don't know shit, you don't know anything. That I haven't eaten a full meal since Friday. That my little brother is failing math and got suspended for rough-housing. You don't know shit about anything. I can't do some of the textbook assignments because I don't have access to a computer at home. And between taking care of my little brother and sister, I really don't know if I have the time. And you know what… Never mind… I have to go."

He grabbed his book bags and left to go.

Hillary was devastated. Had she underestimated the troubles this kid had? Had she assumed that he would have the same privileges and opportunities as she had? Surely she couldn't know any of his problems at home. If she had known, then she wouldn't have called him such derogatory names, or used such insulting terms. I didn't know what this kid was going through. I couldn't pretend to be an omniscient observer. Such surprises are uncommon in my field.

Author's note: Not particularly proud or fond of this story. There's a "twist" at the end but ehh.