Hello.
First of all, I would like to make a small disclaimer -- I am not actually a programmer. I'm a network analyst by trade -- I design, implement and maintain network stuff. Routers, web servers, unix junk and the like. I work as a consultant most of the time, because I enjoy working on many different networks at the same time -- keeps things exciting. Turns out I was responsible for deploying a web application to the production server every two months or so, and the in-between updates.
I proposed (and implemented) a few changes to their developement model two years ago -- using subversion properly instead of their mess of a CVS server (cvsnt), using a stable branch and a developpement branch, tagging before releases, merging, use of Trac (think bugzilla + a wiki + time management + history), proper release schedules, proper release flow (testing - pre production and QA -- production), the use of development servers, etc etc etc. This was, and still is the workload of a titan. I would also like to mention that I have grown with a strong distaste for Macromedia Jrun.
The application is actually a catalog engine, and basically the whole website. Makes no use of a J2EE stack at all, it's just a bunch of servlets calling methods inside a jar that actually resides in the classpath. So no war, no ejb, nothing. I tried changing that too, but I gave up half-way.
The code for the "library" (which is the actual java application containing the catalog engine, the connection manager and everything) is relatively clean. The java programmer over here is a nice lady, and she tries to keep things clean as much as possible, which is a feat, considering the fact that this code base has changed hands six times since, and no previous programmers left any sort of notes. She kept the javadoc up to date as much as she can, which is cool.
Now, I am moderately skilled in Java, which is a skill I sort of picked up in the course of trying to understand J2EE servers for this gig. Having some vague previous programming experience also helped, and reading here also helps. In a "don't do such things" way.
Now, I asked the programmer a question regarding how the search engine was actually working on the website, and she actually answered that she was not too sure herself. There are many gray areas in the code, which are too painful to decipher. In her defense, I must say that is true. I fixed an SQL injection hole in the code a few months ago, and what I saw gave me a headache.
So, I read the code and get a basic understanding of what's going on, which is not too bad. But I'm at loss regarding /how/ these six methods calling each other are called. So I venture in the actual dynamic code embedded inside the html pages. What I saw had a profound effect on me.
This is just a short example. This is actually the cleanest part I could gather. At the moment I glanced upon the giant clustefuck of OR conditions running methods that were running more methods and forever on, I audibly heard something snap inside me. I think something broke inside, and I felt my heart sink.
I have come to the sad realization that things will never go smoothly unless the whole thing is rewritten from scratch. I am really depressed. For the first time I have truely understood the things people feel when posting these WTFs here.
And I only wished for the developpers and maintainers to be happy. God, the futility of it all. And I wrote a few scripts to automate part of the deployment procedure, and I start to wonder if this doesn't add an unecessary layer on complexity to the whole "Maintain the web site" task. I try to make the script as easily maintainable as possible, but now I wonder.
What the hell am I doing? Why?
Oh the questions :(
I can't wait for this project to be over and go back in my happy little world where the worst mindfuck i'll encouter are fucked up ISA setups and firewall rules that I'll just rewrite without feeling like I'm nullifying an entire heritage of sweat, pain, and wasted dollars, or really badly configured Unix boxes that I'll just redo from scratch in the name of "upgrading hardware". Or in the best case, just enjoy the mental challenge of actually fixing a windows box instead of reinstalling. (This is actually a lost art -- it helps to know your kung fu).
Phew. Yeah.
Sorry for the outburst, I just realized why I stopped wanting to be a programmer when I was in high school. I just had to share.