Welcome to the followup of my Tales from the WTF company. If you haven’t read the first part yet, I’d suggest you do. Otherwise you’ll miss important background info and a really funny story, too. This part starts where the last part ended, around noon of the second day.
Let me introduce you to our manager: Jola (name changed), a woman in her late thirties with no technical or managing education. She was earlier providing HR and legal services for the company, but shortly before I started work there she was asked by Johann (name changed), our German CEO, to become the manager.
I guess that Jola was brought to the company because the CEO was not satisfied with the achievements of his Polish branch: their application was slow, massive, bug-ridden and adding new features took ages (he told me about this on the recruitment interview). He also told me that he was looking for a more experienced developer to mend their ways and that was going to be my role after employment.
Around noon of the second day Jola called my team to a meeting. She told us that she received a phone call from Johann and he expected our team to do following tasks ASAP: make changes to the layout of some email sent by the application and make some report (that was already done) accessible from their webpage. The guys had some questions about the details of those tasks but she couldn’t answer them. Instead, she noted the questions word for word and said she was going to call Johann to ask him and then she would give us the answers.
After the meeting we went back to our normal activities: I resumed browsing the project source and they resumed chatting about movies on TV, watching game trailers and funny flics on youtube.com, showing me the webpage selling some paintball guns they bought recently and other fun activities. I wondered when they were going to start working on the tasks they were given, but I figured that those tasks was probably so easy they can do them anytime. At the end of that day I asked my mentor if he could give some task so I could help them finish faster and he said he would look for something appropriate.
Next morning I was assigned my first task: check to see if a particular utility class could be made faster. This class was another piece of classic WTF-ery. Its main purpose was to parse XML file the hard way, because who needs any stinking built-in Python classes when you can use regexps and individual character manipulations? After parsing the contents of XML file were stuffed into nested instances of this class that exposed a dictionary-like interface.
I started by making a suite of characterization tests first as not to break anything unintentionally. This was the first time that any tests were created for their system so it took me a while setting them up. I asked them why there were no tests and their answer was: tests are a waste of time. When I started arguing (being a TDD fan myself), my mentor just cut short the discussion with: when Johann calls you and starts yelling at you, you won’t have time to write those stupid tests.
The yelling part left me with no further arguments and I really started wondering what a mess I have gotten myself into (it was only my third day of work at this company). I resumed my work and by the end of the day I managed to make retrieving values from the above mentioned XML parsing class about 20 times faster on average. It was really easy, though, because this class stored the data internally in a dictionary but the lookups on it were done by sequentially iterating through all the keys to find matching one. All I did was replacing the iteration with normal dictionary lookup.
The guys said that the iteration was probably necessary for something in the past, but they could not recall what could it be. They figured that the cause was probably gone, since the system still worked fine after my changes. I was told I should commit my work to the SVN, but not the tests, because they “didn’t want them to clutter their repository”.
Next day I asked my mentor if I could replace the regexp based XML-parsing with some standard classes to make it cleaner and easier to extend. He said no, because their parsing works just fine, thank you. It just “does what it’s intended to and there’s no need to extend it” (although the code was literally ridden with special cases, multi-storey
ifs, workarounds and bugfixes that proved it was changed and extended many times already). He also stated that their solution was surely faster than any library could be, because “it did only what was needed and any library always does many unnecessary things”. I was told that he would find me another task and I was to leave that XML parsing alone.
Before he could find anything, Jola rushed into our office. She was very angry and told us (almost shouting) that she just had a very unpleasant phone talk with Johann and he demanded that the task he gave us on Tuesday be done today or else. Because of that she wanted us all to work today as long as it’s needed to finish those tasks, even if it takes us whole evening or night. I was quite shocked by this kind of management but other guys seemed used to it. They told her that they’d had some difficulties but now they were nearing the finish and there’s nothing to worry about.
After she left, I saw them working probably for the first time in four days. Of course, they were still doing many things unrelated to work, but at least they were trying to make some progress. I asked my mentor if he could give me something to work on so I can help them finish faster, but he told me that they have already divided the work and it’s too small to be divided further (which seemed to be true because the tasks Johann gave us looked really easy). He said that since he was too busy with his work to find me another task I should just browse the code and try to learn what it does.
At 17:00 I asked them again if I could help them anyhow, but they told me they were almost finished, just fixing some minor bugs. I decided to go home then, because it made no sense to me to sit there and just wait for them to finish.
Next morning Jola asked me to come to her office. I was expecting some kind of reprimand for not staying at work with the other guys (they stayed until about 20:00 that day) and tried to prepare some explanations. She gave me a talk about how they, being a small startup, should be working twice as hard as the bigger companies and then she said that she had to fire me and had my walking papers ready.
After first shock I tried to explain to her why I left earlier and that it’s too harsh to fire somebody for something like that, but then it struck me: I didn’t want to work there anymore. So I just said: “I see that you have already made your decision, so there is no use in arguing”, grabbed my things and left.