04 May 2007

Pride

Whew.

My last project of the semester is finished. (Okay, I have to pretty up the code a bit, but it's all there, and it all WORKS, and that makes me a happy, happy girl.)

While working through it, though, I re-learned a lesson that I seem to have learned so many times before.

My biggest character flaw is definitely my unfailing tendency to always think that I'm absolutely correct in my hunches/intuition/approach to code/math/interpersonal situations, etc, and not to realize when I might not actually know or understand entirely what's going on.

I spent almost an entire day debugging one tiny error I'd made in my code, something that could have been fixed easily by
a) Me sitting down and going back through the project description, and thinking through what each of the components were actually doing.
b) Me being more objective in my debugging.

Without getting too technical here, I was writing a really basic web proxy - basically a middleman between a normal web browser and a server (the thing that stores all the content you see when you access a web page, for example.) When I was trying to get it working, I thought that my proxy had to remove some headers that the server sends back. The headers needed to be there, though, because the client (web browser) needed them - more importantly, the client was removing the headers itself; the fact that I was removing them meant that the client was stripping out all the actual file content.

This would have been a pretty easy error to catch, had it not been embedded in a couple other errors I was making. I tried to debug what was happening - of course, I approached doing that by playing around with CMU's test driver code. This has usually worked for me in the past, but in this case it made things infinitely more difficult since I thought I understood what the drivers were doing, but I was a little bit wrong - wrong enough that I totally misled myself about what I was doing for a good 10 hours or so. I didn't know the driver language (Perl) that well, but I assumed I was competent enough to follow the code...and so it went.

When I finally caught the bug and fixed it, I promised myself that I'd be more careful about just going with the first assumption that popped into my head.

Then I proceeded to repeat the same mistake again today. I was on the last part of the assignment, which was writing a data structure to store the recently accessed web pages. I kept on getting an error on the last test in the code, and automatically assumed it had something to do with some signals that the server was sending back to my proxy. One of my friends was keeping me company at the time and suggested I check the data structure, since the driver code was testing primarily just the data structure at that point. I just said "No, I think it's this other thing..." and kept on for another couple hours.

I finally caught that bug too, and guess what? It was in the data structure. I didn't even catch it at first; my friend saw it almost immediately when I headed to that section of the code, though.

It's frustrating...it's really true that I am my own worst enemy sometimes. If I could put my pride aside just every now and then, I could save myself SO MUCH stress and frustration when it comes to things like these projects. I could have been done with this project last night and had time to really enjoy today (the end of the semester, and ECE day) if I could just have taken a few steps outside of my own stubborn mindset.

I hope I figure out how to get myself away from doing this, at least so much, because I don't want to keep doing this to myself for the rest of my life.

No comments: