A Few Quick Pointers

if-then-else (ɪf ðɛn ɛls) A high-level programming language statement that compares two or more sets of data and tests the results.

 

if-then-else

I have never programmed before and I have no idea what I’m doing.

I walked into class today expecting to be surrounded by a bunch of newbies like me—I mean, the class is called “Introduction to C++ Programming,” for crying out loud—but no. Right at the entrance to the classroom is some guy who has apparently spent the last several years of his life teaching himself how to program, with a bunch of words I didn’t know had anything to do with programming. Java, Pearl Perl, Ruby (at least that one’s spelled normally), HTML, CSS… I stopped listening after the first six.

Fortunately, the teacher started things off pretty simply.

“So this,” he wrote the word “if” on the board, “is an ‘if’ statement. What follows it, within these curly brackets,” he drew them under the “if,” “will only run if the condition of the statement is fulfilled. For instance,” he added “x < 10” to the right of the “if,” “anything in here will only run if x is less than ten. We can follow it with the word ‘else’ to do something else if the condition is not met.”

The concept is simple, but that doesn’t make the execution easy. I tried to follow the steps to write the program due tomorrow and I ended up with a “null reference exception,” which, from my limited searching, should not happen on such a simple problem, so nobody knows how to fix it. I may be in over my head.

 

while (waɪl) A high-level programming language structure that repeats instructions if the results of a comparison are true.

 

while

From my perception, programming is at least eighty percent based on making people question their comprehension of the English language. I haven’t had this much trouble contextualizing the English language since first grade.

We moved from if/else discussion to while loops today, and the others seem to be picking up on how much I don’t know. A couple of guys started laughing at the seats across from me, and when I glanced over, the only thing on one of their screens was:

if (Drake)
{
     x = x/0;
}

Really funny guys. As all this was happening, the teacher was describing the use of the new “while” keyword on the whiteboard.

“So as I was saying, anything inside these curly brackets will continue to happen as long as the condition is met. Be sure to use this in tonight’s homework problem.”

I must have missed some part of what he was saying, because when I tried to write the program, the window my program popped up just filled up with the number four. I was hoping it would get better if I just left it alone, but I came back in the morning and my computer had crashed. One of these days, maybe I’ll actually get programming right.

 

pointer (ˈpɔɪntə) In programming, a variable that holds the address of another variable or the address of the beginning of an array of variables.

 

pointer

I decided today that it might make sense to ask one of the others for some help. After all, if they got it so easily, maybe they could explain it in a way that would make sense.

Oh how naïve I was.

I showed up to class early to seek help. The teacher wasn’t there yet, but the self-taught guy was there working on stuff, and one of his friends was hanging around.

“Hey, Dmitri,” I greeted him with a wave and received a quizzically raised eyebrow in reply, “I was wondering if you could help me out with some of this syntax stuff, maybe give me a few pointers to help solve today’s homework problem?”

He laughed. I didn’t like that laugh, but I urged myself not to question it.

“You want some pointers? Alright, let me see your code,” he said, exchanging a scheming glance with his buddy and saving his work.

I pulled up the source code I had, and after he was done wincing, he went to town on it, adding several lines that I didn’t even know how to read properly.

“Uh, hey, I was, uh, hoping to actually learn how you’re solving it, so I know better for next time,” I cut in.

“Oh, I’m just typing this up so it’ll work, I’ll walk you through it once it’s done,” he assured me. A minute or two later, he leaned back, “Alright, run it.”

I’ve been told before that I’m too trusting. Perhaps the way he and his friend were snickering as I took the mouse should have indicated to me that something wasn’t right, but either way, I clicked run and every computer in the room whirred to a halt.

Based on the confusion echoing down the hallway, every computer in the building whirred to a halt. Based on the phone ringing and frantic scrambling down the aforementioned hallway, every computer in the school district may have whirred to a halt.

Dmitri and his friend were cracking up at this point. I was just staring at the screen in dumbfounded shock, trying to figure out what had even happened. Within a minute, the teacher walked into the room, arms crossed.

“You clowns had better have an explanation for how you crashed the entire school district network in the ten minutes I was gone,” he glared.

Dmitri stuttered out a response through snickering, “Drake asked for some pointers, I just did what he asked.”

The teacher’s shoulders slumped and his glare turned into a look of aggravated disbelief. From a bit of research I’ve done since getting home, pointers are direct references to computer memory, and can very quickly get out of hand if poorly handled—say, by giving code to someone who doesn’t know what a pointer is. Somehow he deleted a file the entire computer network hinged on. On the bright side, I guess I don’t have to suffer through programming class anymore?

Leave a Reply

Your email address will not be published. Required fields are marked *