Last Thursday night, I decided to finally start on my 3 computer science programs that I thought were due on Sunday night (they were actually due 2 days later … a big relief!). I figured that this wouldn’t take that long. I had to write a program that would spit out certain prime numbers to the user. Of course, there were more specifications, but that’s the general idea. Maybe it’s a bit hackneyed, but I decided to make a record of what happened in a diary format. It may be used by me as a way to laugh at myself.
Some background: I’m programming in the C language, and I’m using emacs to assist in compiling and input/output.
11:09 PM: I arrive in the computer science lab. It’s in an obscure room on the top floor of the science center (third floor). At least it’s (a) close to my dorm room and (b) has a nice view on both sides of the room of the science library below. I see that four other guys are there in the lab. They’re probably all in some 300 or 400-level class.
11:37 PM: After nearly a half hour of frustration with emacs, I finally figure out how to start typing my C program! Why couldn’t this be on a crystal-clear template? My “Intro to emacs” sheet lists commands, but it doesn’t have suggestions.
12:00 AM: It’s midnight, and one of the guys working near me keeps throwing a ball up in the air and cursing at his computer. I resume typing my program, which is going well so far.
12:15 AM: The guy who kept cursing and banging on his desk gives up. He tells his classmates that he’s had enough for the night. I find out that he’s in an advanced compilers class. He leaves, and one of his classmates follows suit.
12:32 AM: My code should now work for numbers (as input) that are less than or equal to two. Mission accomp … oh wait, I have to take in account input that’s greater than two?
1:00 AM: Still toiling in the lab. One of the guys who had left a half hour ago brings some pizza he got and offers it to me. It’s sausage and bacon-flavored. No thanks. I prefer cheese and buffalo chicken pizza.
1:26 AM: The second method I have is malfunctioning. Why?!?!? I decide to take a break and re-fill my water bottle.
1:39 AM: I think it works! I test out the program and it works for 0, 1, 2, 3, 4, 5, 6, 7, and …8?!? Crap, it works for all numbers OTHER than 8? And I was just about to leave.
1:48 AM: I “revised” my code. Now it doesn’t work for the number 3! (That’s not a factorial, by the way.)
1:59 AM: It doesn’t work with number 10, but it works with all other numbers. What is going on with 3, 8, and 10 tonight?
2:04 AM: Well, that’s it. I think I’m done for now. The program should now work for any number that’s inputted by the user. It’s not completely done, since I’ve got to take into account multiple integers as input, but I’ve done as much as I think I can manage. I need to sleep. I walk out of the building and in about 100 steps I get back to my room. Good night. I realize that if I were using Java, I would have finished before midnight. But Java sucks.
It’s a bit late now, but tomorrow, I have to finish up these programs.