The inside of the train was rather small, but clean. The floor was decorated with semicolon art, and as Robert and Sunny made their way to some open seats, Sunny noticed patterns of punctuation on the walls as well.
The pair found some empty seats in train car 3 and settled in as the other passengers found seats as well. Sunny looked around, observing the Javalandians and sketching the semicolon patterns in her notebook. But soon enough, she closed her notebook again. “Hey, Robert, about that previous hero…”
“Hm?” Robert cracked an eye open. “I was trying to nap.”
“Oh! Sorry. I was just wondering if you knew any more about him and his quest.” Sunny fidgeted with her pencil.
The robot let out a deep sigh, then said, “His name was Jasper. Not as confident as you, for sure, but a decent kid.”
“Did you know him?” Sunny asked curiously.
“No, but I’ve heard of him. He went through a similar journey as you– learning things like variables and conditional statements and loops. And with the power of code, he was able to make the leaders of the various nations listen to him for a moment. That moment was what led to the peace treaty and the end of the war.”
Sunny’s eyes were sparkling. “Amazing! Has anyone written a book about this yet? If not, can I? It’d be a bestseller for sure.” Suddenly, she frowned. “But it needs a happy ending, and you said you don’t know if he made it home. Where is this Jasper now, then?”
Robert leaned back against the side of the train as it started to move. He let out another sigh, then reluctantly said, “No one knows. After the peace treaty, he and his ambassador just… disappeared.”
“What if both he and his ambassador went to Earth?”
“Ambassadors are able to travel between worlds. Jasper’s ambassador would’ve come back.”
Sunny fingered her notebook thoughtfully. “Well, I got here through a portal that replaced my front door. Maybe I just have to find another portal?”
The robot shrugged. “Don’t ask me. I’m going to sleep now.”
Sunny harrumphed. “Fine. Hopefully you’re in a better mood when you wake up.” She pouted for a moment, then returned to doodling in her notebook as she considered the issue.
She mumbled under her breath, “If the portal replaces doors, is there a specific door I need to find? I would’ve thought the return portal would just appear when I finished my quest… Is it even worth trying to figure this out if it’s entirely possible that Jasper did return home? Hmm…”
Sunny must have dozed off sometime, because she was abruptly awakened by the train lurching to a halt. Around her, startled passengers burst into chatter. Sunny sat upright. “Robert?”
The robot was looking around as well. “An error?”
The windows of the train flashed red around the edges. Robert sighed. “That confirms it. Come on.”
He hopped out of his seat, leaving Sunny to pocket her notebook and trail behind him anxiously. A baby was crying in the background.
Robert wove around passengers towards the front of the train.
Sunny called out, “Excuse me! Coming through!” She squeezed past an old couple and hurried after Robert.
When Robert reached car 0, he knocked firmly on the door. There was no response, other than the faint sound of voices. The robot lifted an arm again and banged on the metal. “Robert here, official ambassador from the High Council of Javalandia. Open up so I may offer assistance.”
Sunny blinked. The door opened a crack, then, upon seeing Robert, the person behind it opened it all the way.
Robert floated into the room. “What caused the error?”
A wiry man gulped. “We were just looping through the cars as usual, making sure they were all functioning properly.” He gestured towards a screen.
for (int i = 0; i <= train.length; i++) {
if (!train[i].functioning()) {
System.out.println(train[i].getError());
}
}
Robert scowled at the code, then swiveled towards Sunny. “See anything wrong here?”
Sunny stared at the code for a moment and skimmed it. “Okay, so it’s a for loop with an if-statement inside it. I know that train[i] means a car of the train, but what does .functioning() do?”
“functioning() is a method that’s being called on train[i]. But you haven’t learned that yet, and anyhow, the error’s not there.”
“The print statement looks fine– it has a semicolon. Maybe the for loop? int i = 0 is fine, i <= train.length… wait.” Sunny looked closer. “Hmm. If the train is zero-indexed,” she said slowly, “what would the index of the last car be?”
Robert looked almost proud. “Precisely.” He turned to the train drivers. “If you try to call train[train.length], it’ll throw an error, because the last car is train[train.length-1]. For example, if the length of the train is 5, the cars will be 0, 1, 2, 3, and 4. There’s no car 5. Who wrote this code?”
The drivers looked away embarrassedly. “Thank you, Ambassador,” one mumbled.
Robert rolled his eyes, and Sunny took notes in her notebook.
Soon enough, Sunny and Robert were back in their seats, and the train was moving again. Sunny tapped her pencil against her notebook. Something didn’t sit right with her. “Robert, why couldn’t those drivers figure out the error by themselves? I haven’t been here a week, but that piece of code seemed pretty simple to me.”
Robert snorted. “Some people have become too dependent on error descriptions to tell them what to do. That error had a name once. I can’t remember it, but I’m pretty sure it was specific enough that the drivers could figure things out. Now, though, it looks like you can’t even tell which line the error is on.”
Sunny looked at the Javalandians around her, chattering or resting as normal now that the train was moving as usual. “Those error descriptions are quite important then, huh?”
Robert nodded, then closed his eyes. “I’m actually going to sleep now. Don’t wake me up unless the train falls off a cliff or something.”
“Will do.” Sunny half-smiled, then returned to her thoughts. Maybe it wasn’t as outwardly glorious as ending a war, but she supposed helping solve errors was just as essential to Javaland. She could live with that.
Points: 2564
Reviews: 3807
Donate