Thursday, November 5, 2009

The Difficult Assignment

I remember when I first went to work at my last company, one of the senior people on my team took a dislike to me--I would say an instinctive dislike, like that of a dog for a cat. For a long time, I did not understand why, because I never sought any conflict with others. I think the main problem was that I was male, and she didn't like any of the men in our department, but she disliked gays even more. Since I was both gay and male, that represented a double whammy. The fact that I didn't subscribe to her particular religious beliefs represented the icing on the cake.

She was more subtle than most and knew ways of getting her ends without being too obvious about it. For instance, she found a way to get our boss to transfer her most difficult assignment to me. She had received the task a couple of years ago, but with her cunning had managed to put it off with a variety of excuses. She admitted that it was too difficult for her, which may have been an indiscretion on her part, although she never expected that I would solve it by myself. She was hoping by the confession to discourage me. But I like challenges, if they only involve mind work.

She calculated that since I was just starting out with a new language, the hard stuff would do me in. I'd get canned, and she could work her social magic to get a new recruit that she liked better, preferably a straight white female. Anytime I went to ask her questions about the assignment, she would obfuscate or make a belittling remark questioning my intelligence or work ethic. I took a hint and remained alone in my cubicle, talking to no one, doing nothing but thinking, reading the reference manuals and absorbing many things. I looked at old programs and studied how other programmers went about handling similar chores. Remember, when reinventing the wheel, it is best to reinvent as little as possible. Whenever I found good ideas, I adopted them or made notes of them for future use.

The assignment involved displaying data in realtime on a mainframe screen. Our customer desired the capability of sorting a list of names by alphabetical order (with lowercase and uppercase taken into consideration), and/or by date, and/or by category, and/or by subcategory, and/or by status, and a couple of other fields that escape my memory at this time. Up to ten different flags could be selected or unselected and would alter the results. In SQL, this is a simple matter that requires just a few statements. In the old programming languages, it is not such a simple matter. There was no "SORT" command available of any kind. It was necessary to reinvent the wheel, and that is what I did. I created a series of sorting algorithms, using flags (indicators) to keep track of each of the many different stages of my subroutine. Nested loops held sorts within sorts within sorts. It was a sordid (sorted) affair.

The code was written over a decade ago, and today I am not sure whether my sorts could have been characterized as bubble or insertion sorts. Wikipedia disparages the bubble sort to such an extent that I suspect there would have been complaints over efficiency if I had used it. But I had a vague memory of the various sorting techniques I had learned in college, and "bubble sort" seemed like a fun, nifty name, so that was the label I applied to my technique, whether it was accurate or not. Everything took place in memory, by necessity, without any temporary data files, which meant that each time the user advanced to the next page, the sorting had to be performed all over again. There was not a large amount of data involved.

I was careful to document the program with remark statements, although I have my doubts over how much they helped in understanding the process. The older languages rely quite a bit on GOTO statements, which are rightfully associated with spaghetti code. I tried to use structured techniques, such as subroutines, as much as possible, but it was not always possible due to the limitations of the language, particularly in a realtime environment. As for object-oriented techniques, forget it.

Yes, there were plenty of bugs I had to iron out, but in the end it worked and remained largely unchanged for the next ten years. I think that was one of the tasks that earned me my first raise and guaranteed my job security.

Now of course she wanted to know how I solved it. When I told her I used a bubble sort algorithm, she had no idea what I was talking about and didn't want to know. She never liked listening to technical explanations. Her interests concerned the social hierarchy, and she much more intrigued by the higher-ranked individuals than by anything having to do with the peons. She assumed I had borrowed all the code from another programmer. So she went around asking the other senior programmers if they had helped me in any way. She spent much of every day whispering and gossiping with others, usually about other people in the department or about her husband, who she detested. Only about half her day was ever spent by the computer. No, other than helping with advanced syntax, the senior programmers hadn't had much interaction with me at all. In fact, some of them were unaware I was working there. Some programmers live in their own insulated world and are not quick to notice changes in the outside world, even in their own department.

She was always alert for the risk of someone giving me any assistance or advice, and always sought to nip that in the bud whenever she could. For my part, I am by nature reluctant to ask others for help, especially strangers. If someone else helps me, then I tend to keep an internal ledger with their contribution marked down for future repayment. She did succeed, however, in damaging some of the working relationships I tried to build with others, because she was politically connected, and her boss thought she was the perfect Christian. She did all the little political things. I could see the writing on the wall, in terms of my future at that company. But if you work in such an environment, then perhaps you should do as she did, if climbing up the corporate ladder is your goal.

No comments:

techlorebyigor is my personal journal for ideas & opinions