Can I just share a moment of frustration ...

Started by mhall, December 12, 2014, 03:56:53 AM

Previous topic - Next topic

mhall

;TLDR
I forgot to compile. That's all.


OK,

[Read this really quickly without taking a break. That's how I said it in my head. ]
Not a shining moment ... but I've spent so long tracking this down and had this big long post prepared about the problem I was running into and how I've spent hours and hours trying to debug the darned thing and things just weren't working and values weren't being written correctly even though all of my debugging showed that they should be and there had to be some mysterious bit of code doing something that I just couldn't see ... and I just found what it was and, well, I laughed, but really I wanted to weep ... because I don't think I've been as frustrated over something as I was over this.
[ Now you can breathe. ]

I used Winbatch/Webbatch to manage a photo viewing and ordering system. I was running into a bug where I would calculate totals for an order, save the array of values out to disk but when I read the values they would be incorrect. I checked and checked and checked and logged and logged and logged ... and checked and logged some more. I refactored. Many times. I cursed, fumed, railed and literally lifted my desk off the floor at one point ... and then I decided it would be best to put it back down, after all I still needed it. Then, after two back to back 36 hour days (not all spent on this, but this was the bit that finally did me in) I slept for 15 hours and came back and spent five more hours trying everything I could think of.

And pretty much the whole time, based on everything I saw and logged, it SHOULD have been working fine. In the code I was testing the values all came back correct. This particular function was the ONLY place that calculated or wrote these values. But mysteriously, something was changing this array file on disk after I wrote it. But this was the only thing that wrote it and it should be fine ... so something else was modifying it ... but there was nothing else that could be modifying it.

I was definitely going in circles.

And then, after all of these hours of looking. I decided to take one more step back and make sure I was looking at the entire process from to bottom to make sure I wasn't missing something (because it was excruciatingly obvious I WAS missing something). And there it was. My moment of shame. In a effort to speed certain operations from the user perspective, I recently created a small executable that would handle extraneous processes that didn't need to block the user, but could be run and allowed to complete after we had returned our results to the browser.

And, inevitably, one of the functions that this executable would perform involved calling an update to order totals ... which is the one function that I was having so much trouble with. And this executable hadn't been recompiled. It was still using the old code.

*big sigh of relief and frustration and an intense desire to go kick something*

Recompile.

Oh, look, it works.

I really don't ever want to do that again.  :-[

I think I'll go have a coffee now. And maybe kick something.

~Micheal

JTaylor

Sorry for the hassle...have a little experience along those lines myself.   I know you weren't looking for a response but one suggestion, if you are not familiar with it, is to use the "Batch Compile" option for your projects.   That way, every script you use will be compiled every time and you will normally avoid such problems.  Details are in the Winbatch.chm file, if interested.

Jim

mhall

Hi Jim,

Thanks very much for the tip! That will prove very useful. I'm always open to suggestions,

I hope I didn't come across to ... whiney ... in my post. It was an attempt to share some frustration with humor.

I just have to remember the compile step as I work. Most  ( >98% ) of what I am working on at the moment is run via Webbatch, which cannot be compiled, so I"m simply not used to the step. I modify and hit F5 to test. Or I have a test script that I use as a scratch pad for testing out individual functions without the browser.

Hopefully, this experience bit me hard enough that I won't forget it.  :o

Regards,
Micheal


JTaylor

Not at all...most of us can sympathize.   It is the simple things that cause the biggest headaches :-)

Jim

DAG_P6

Quote from: JTaylor on December 13, 2014, 10:39:42 AM
Not at all...most of us can sympathize.   It is the simple things that cause the biggest headaches :-)

Please, please give me a hard problem, any day of the week. Most of our toe stubbings come at the hands of little problems. ;)
David A. Gray
You are more important than any technology.