« A Bit of Wisdom | Main | Pointless University Stories II: The Ten O'Clock Yell »

Pointless College University Stories

Stealing from the gang over on Livejournal, I present a Pointless University Story (college is a whole other thing up here):

I studied computer science in University, and while we were all computer geeks, we weren't all particularly talented computer geeks. One day in first year, as we were working on an assignment on collision detection, one of my friends called me over to her dorm to help her figure out why her code wasn't working properly.

It was supposed to read starting positions and velocities from a file for two objects and detect whether they collided or not. No matter what she put in the file, or what file she provided as input, she was getting exactly the same result, and it was frustrating her madly.

We did about 90 million different things to the data sets and file names and code and stood around pensively discussing the ever increasing possibility that the computer was just frigging haunted. We tried turning the computer on and off in case there was something nutty in the memory that was screwing us up (that she was probably dialed into the university unix servers made that step especially pitiful, but man, at that point, we'd been at it for like two hours, and we were getting punchy and stupid).

Eventually, we sat down for about the 9th time to pour over the code searching for the problem. And finally, I noticed one rather innocuous little line. That was hardcoding the name of the input file--rendering all of the files that we were creating and passing from the command line completely pointless. Also rendered pointless were the times we'd tried hardcoding a different filename, since we did that in the main program, and the one we didn't know about it was in the file reading function where we weren't looking.

D'oh!

Almost but not quite as annoying was the program I wrote that would segmentation fault if the first line wasn't a printf statement, but was fine as long as it was.

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)