Messed up good

My project is messed up good. I would very much like to strangle it, if only I could strangle code. I am still wondering how this happened and what really is screwed up and wether I can fix it.

*How did it happen?*

Well the project started out with me saying: “I am sick of maintaining this perl project, boss, let me convert this to a pure java one, I have seen a java library doing just what we need. It won’t take long and afterwards it will be much more dependable and extendable.” My boss had been whining about those last two isuues for some time. My mistake probably was the “it will not take long part”.

I proceeded to analyze what I would have to do to convert the project (1k lines of perl code). Then I went to my boss again and we made a specification well no actually we made a list of requirements (like: improved errorhandling, logging, scalability, parallelization …). I just found out that “specification” and “requirement” both mean “Anforderung” in German. After the requirements we should have made a spec and then evaluated how much time it would take to implement. First error.

I knew beforehand that re-implementing the present perl-functionality wouldn’t suffice. The “thing” had a website associated with it that was based on a couple cgi scripts provided by the original implementation of the library I was using. Of course the new java library would not provide cgi scripts but java classes. So my boss suggested using pustefix for the web interface. After all the pustefix framework is being developed by my team. I “acked” that suggestion and planned to get to that part after I finished programming the “backend”. I have never before done a project with the framework and knew a lot of time would be needed to get “into it” , still I ignored the requirement until I was done with the backend. Second error.

I started writing the backend. I asked my boss wether it would be smart to make the backend a daemon thread instead of a cronjob. He said: he wanted it to stay a cronjob. I implemented it as a cronjob. Third Error.

I tested the backend. Sloppy. I did not use unit tests (because I did not know how to and how valuable they are). Fourth error.

I could continue like this. My design sucks. It is full of cyclic dependencies between my packages. It’s nearly “untested” as far as unit-tests go. I have lost the grasp of what everything is doing. I have already spent two days in a row just refactoring some of the stupidities I have implemented. I am pretty sure that my threads are probably out of control, I have non-reproducable errors creeping up every once in a while. The web interface is nowhere near finished and I had planned on being done this wednesday. Alas, there is no real deadline. Fifth error by the way.

I have started trying to improve, myself, my methods and of course my project. But by now it’s around a 100 classes big …. I don’t really no where to continue.

Today I spent the whole day refactoring the classes in a certain package to be able to test them with junit. Guess what. I am done refactoring, I am only half pleased because something smells just as fishy with the new code as with the old code and I still cannot test because of some sucky Singleton-freakiness I built into the code.

Guess what else: I am leaving for today, and tomorrow everything will have settled into being even worse. Have a good evening.

This time I really don’t want any good tips on this. I just needed to write this.