Excellent II

by zenquaker

Yesterday started out pretty well. Since I’ve been getting up in good order of late (although I bobbled today), I was the first person in the office besides my supervisor. He took that as an opportunity to drag me into my interim performance review. These usually go well for me. I’m not one of the slackers, my programming efforts are central to my division’s work, and I keep up to date on all the software we’re using so I’m the SharePoint/SAS/Sharp Floor guru. However, this was the first time the word “brilliance” has ever been used in one of my performance review. Personally, I think that was a little over the top; but I am working on graciously accepting praise.

Friday is the day I try to set aside to do some programming. It’s the part of my job I really enjoy (I’m about to delve deeply into the details of it, but you skip to what happened later in the day if you want). Right now I’m working on modifying my search program to work with Sharp Floor. We used to have four databases, all of which were similar. I got tired of writing similar search code four times, and wrote a program (codename Moving Wire)  to do it for me. I just give the search program one set of search terms, and it handles the differences in the databases for me. I then added in a fifth database that we get from a third party. This program became the guts for other programs essential to the division.

Now three of those databases are in the Sharp Floor database, so I’ve been working to rewrite Moving Wire to handle Sharp Floor. At the same time I’m completely redoing how the program works. Generally it works by generating its own search program and then running that search program itself. But the program it generated was all hard coded. That is, to change the program it generated you would have to change the Moving Wire program. In the new version, the generated program is an external program with variables in it, and Moving Wire just manipulates the values of those variables. That way the user can modify the external program without understanding Moving Wire at all. They can change what fields are pulled from the data, and add some processing after the data is pulled.

Additionally the new version has a template that specifies how the search terms provided to Moving Wire are translated into the variables that are in the external search program. The original plan for all of this was to make it easier to add new databases to Moving Wire, or to add completely different ways to search the databases that it already works for. This is especially an issue for Sharp Floor, which has a lot of tasking information that would be useful to search on. But I’ve been having trouble figuring out how that is going to work.

You’re limited by the search terms that Moving Wire understands. Those are still hard coded into Moving Wire, so you would have to change the Moving Wire program to add a new search term. When you use a search term with Moving Wire, you also give the values you want to search on. Moving Wire uses different functions to convert the values you give it so that they can be used in the external search program. Each search term is mapped to one of these conversion functions.

Yesterday I realized that I could move the mapping of which search term goes to which conversion function into the template that specifies how the search terms are translated into the variables in the external search program. If you do that, then Moving Wire doesn’t need to know what the search terms are! That means you can remove them from the Moving Wire program completely and allow the user to specify them as whatever they want in the translation template. That means Moving Wire can now be used to search just about any database there is. You wouldn’t necessarily want to use it in all cases, or even in most cases. I would take some work to set up a database for searching by Moving Wire, and that work would only be worth it if you could take advantage of Moving Wire’s ability to search across databases, or to generalize search terms for a large number of searches.

So to recap for those who skipped ahead, I had figured out how to convert my program into a customizable universal search engine. Not only that, in a few hours I managed to rewrite the program to handle the changes and get it to work on one of the full test cases I had set up for the program. Oh man was I riding high. Solving that programming problem and having my supervisor call me brilliant had me on top of the world. I set up a full test run and took a piss break. I was standing there in the bathroom, looking at myself in the mirror, and admiring how intelligent I was.

That’s when I realized I was so brilliant I’d put my shirt on backwards that morning.

That was a perfect bit of ego deflation right there. I’m still laughing about it. It also set me up perfectly for the full test run returning a lot of errors. Many I was expecting given how the program had changed, and I just wanted to know what parts of the test program needed to be redone. Some of them were not expected and are rather problematic. Nothing I can’t deal with, but more work needs to be done.

But before I tested the new version of the program I remembered something very interesting. Frequently when I am about to do a test run of a program I stall. I check my email, or the web, or wander off to talk to someone about an unrelated work issue. I do this because I am afraid to do the test run. I’ve noticed this before. My conclusion before (which I’d forgotten) was that I am afraid of failure. There are good historical reasons for this conclusion. My parents were not the sort to recognize my achievements or have confidence in my abilities. I was driven to succeed in order to get their recognition and confidence. Not only that I was a freak from a very early age, and was ostracized because of it. For years the only way I could get recognition and acceptance from my peers was by performing better than they did. Failure ruined all of that. Failure meant no recognition, no acceptance, no confidence, and a return to the loneliness and feelings of inadequacy that plagued much of my youth.

This is important because I think the same problem is at the root of my anxiety with playing Chess against real people. Furthermore, I know that my fear turns into anger. I saw this early in my Zen practice when I would try to be mindful while driving on the Beltway. I saw through the anger I had toward other drivers and saw that it was fear that I was going to die on the road that day. I think that anger is at the root of my frustration with my performance playing games. I love games, but I have known for a long time that when I lose a lot I get very frustrated with myself. It has gotten so bad at times that I have had to completely stop playing games for months at a time. It was something I was worried about when I decided to start working on my Chess game seriously. I mentioned it in my Simple Method planning notes for the first habit of working on Chess tactics every day. I think that frustration is my fear of failure becoming anger and turning back on myself.

I don’t know what I’m going to do about it. But knowing what the problem is allows for the possibility of doing something about it, so I’m going to view that as a huge step forward.