Taking shortcuts occasionally gets me in trouble…

Programming
April 24, 2013

Today I was working on my second-to-last college programming project and getting frustrated. I started this assignment a week and a half ago, planning to work on it a little bit each day. Saturday rolled around and I spent several hours working on it and getting to (what I thought was) a good stopping place. Sunday and Monday, I worked on it more and thought I had it running – until I looked at my benchmark results and realized that I was totally off from the expected values. I spent all of Monday night trying to debug the program and found out that I had misunderstood one part of the assignment – a very crucial part that meant rewriting the whole thing.

That’s what I did yesterday – and then I thought I had it. I ran the program. Benchmark results were still off. I spent several hours over the course of last night and this morning attempting to track down the bug but nothing I did fixed it. I was defeated. I was prepared to take a bad grade on the assignment and hope for the best with my midterm grade. I gave my code another look – and I saw this:

code

Yeah. When I was copying and pasting over the code I could salvage from my first attempt at the project, I forgot to change the second two ‘if’ statements. The second and third statements were meant to represent user stations 2 & 3, all of which had unique mean exponential times for the generator function. The way my program was running only generated jobs from the first group.

I fixed that part of my code and the whole thing worked instantly. I make some of the silliest mistakes when I program!

Related Posts

Leave a Reply