The line of work that I have chosen so far in life, is that of a programmer. Every day that I am programming I am in a constant state of learning. I have never been so arrogant of my abilities to assume that I am better than anyone. I guess I’m humble that way, perhaps even not confident of my abilities compared to people with whom I’ve worked and I have worked with alot of amazing programmers. I guess thats why I am in a bit of a state of shock. I have an “acquaintance” that I have known for quite alot of years. We worked at the same company for a year but never really worked with each other on any projects. When he left the company we kept in touch meeting for coffees and sometimes breakfast, where we shared ideas, stories, even contacts and inside scoops on local interests. I thought we were good friends but looking back on it and in light of current events I’m realizing that may not have been the case.
Somewhere along the way he started to treat me like a second class citizen (oh ya, how dramatic, I know) but unfortunately I’m realizing its true. I guess in a way I looked up to this person as I was always regaled with stories of the wonderful stuff he was doing and the travelling he was involved in. I guess I was a little jealous. What has me thinking alot lately about our friendship was the stupidest piece of Java code that he wrote and I saw. After spending many hours having to deal with this pittance of a piece of code I finally had to rewrite it. In my arrogance I started spouting off about how I was going to have to give him a hard time about it. Tease him a little about the folly of his ways with regards to this little piece of code. 2 Days later, before I could “rib” him about it, he had been fore warned of my spouting off about it and either pretended to, or was in fact hurt by my spewing about it.
We discussed it. For me the conversation started out jovially but he came across as hurt and offended that such a low-life as me would question code that he wrote. Again with the lack of confidence that I have in myself I conceded that he should not have heard about it second hand. Usually our conversations are jovial and joking but during this conversation he was not. I explained to him why I had to change his code to which he didn’t really listen to or care about. We argued back and forth for several minutes when he brought out the “well if you want to judge some code, lets have a look at yours…” knowing full well that he had been working on code that I wrote that he was having a difficult time understanding because of a poor design on my part. I backed off arguing with him about it any further, again because of my lack of confidence, but for me the damage was done. I think I smoothed things over with him, but obviously for me I wasn’t satisfied with the outcome. I think what hurt the most for me was that I expected better of him and for him to be so argumentative of such crap code, I was shocked.
I for one suffer from poor design in my coding, sometimes, I know this about alot of the stuff I do, especially with large amounts of inter-related code. I get lost, not in the details but in the overall design. Everything about his code was done to satisfy a tiny requirement, quickly. I’m sure there wasn’t any thought put in to the elegance of the code, or how well technically it was written. It had to do one thing and when the app is compiled, pointing at the correct database, it would deliver upon its one simple task. Unfortunately for
us me at work, there are unit tests involved with our codebase and through attrition I have become the keeper of the code. His code did not fit in with that codebase. It broke unit tests. It broke our build. I tried for many hours to NOT change his code and to figure out a way to work around his code. After working past 11pm on just his code I decided it had to be rewritten. Were there other ways? Possibly. In my mind it was not well written code.
If you’re making a connection to a DB and using Statements and ResultSets it is common to have that code surrounded by try-catch blocks isn’t it? His code didn’t have any of that but for me to add that wasn’t a big deal at all. It was the way that it didn’t fit in with anything else in the codebase that bothered me. We have written unit tests and for testing Struts action classes, it is common for
us me (alone now) to use Mock classes to allow us to concentrate our unit tests on testing that action class and that class only and not have to worry about some other class that was being called from within it that didn’t necessarily affect the output of the action. He put his class in the wrong package and he didn’t run the unit tests. Okay that’s enough of my “code-arrogance”. Sometimes I do get all high-and-mighty.
At the end of our argument over it all, he conceded that it really didn’t matter to him as it wasn’t code that he was going to have to support. He’s working on contract and isn’t going to be around to have to worry about it, perhaps ever again. I think thats one of the reasons why this has bothered me so much about this tiny bit of code. He just doesn’t care, yet the person for whom he’s working for (the owner of my company) he supposedly has the utmost respect for? If that were true, would you do something so crappy for them? I guess the ‘ol bottom line comes into play. Time is money. Crappy code is quick.
I thought better of him.