Wednesday, March 26, 2008

Find A way dont fix YOUR way

We've all been there. You get an assignment and you come up with a great way to do it. You sketch it out, your logic makes sense. You write the code and run it and somethings wrong. So you spend hours, days trying to find and fix the flaw in the logic. Why? sometimes it's an emotional investment in what you've created. Sometimes it's for what you convince yourself are pragmatic reasons. You say to yourself "this IS the best way to do it". Other times it's just the thrill of the challenge to MAKE a thing work. I was in this situation yesterday and for two hours I sat, trying to make MY way work. When I finally decided that it was best for everyone that I just made it work, not the best way, not my way, but some way. I had already conceived of a less beautiful less elegant way of accomplishing what I wanted, and it would mean doubling the run time of the script because I would need to loop through my input set twice instead of once. But really, what's the difference between .003 of a second and .006 of a second. This was not a routine that would be run a hundred times a second but one that would be run three or four times a day. I just had to swallow my pride and MAKE IT HAPPEN. So I suggest this to those who are reading this. When you run into one of these situations, swallow yoru pride, and find a way to fix it, don't fix your way.