I'm sitting here wondering what's wrong with poorly written code. I think that poorly written code is code that has no error handling, no documentation, uses a lot of random global variables, undefined variables, repeating lines of code in a procedure instead of calling subroutines, and so on.

What's wrong with it if it works?

In Feb, a friend asked me to develop something for him and demanded that it be in VB.Net Express. I wanted to do it in old faithful, VB 6.0. He said, "I want to be able to follow what you're doing."

I developed the entire thing he wanted with his constantly changing requirements (his first time as a s/w project manager) and changing plans. When it was all done, he found out it would cost him too much money to distribute his project in the .Net format and wanted to redevelop the entire thing in VB 6.0. He asked me to do it in three weeks. I said I'd do my best but it wasn't likely.

Friday he released "his" version of the project with the above described method of coding. Apparently, after I started his VB.Net version, I inadvertantly inspired him to learn VB. The only thing he had access to was VB 5.0 (yes 5.0). So while I was killing myself to meet his constantly changing requirements and deadline, he was "learning on VB 5."

He told me he was sorry he didn't need my version afterall and that he was very lucky because "he's a quick learner." But, "thanks for all your help because my work spun off of yours."

When I explained to him that his code had no documentation or error handling and his code had profound reduncancies, he replied, "it works on my machine, I don't see the problem." "I looks like [a child] wrote it, but it's done and I didn't need error handling or documentation." He plans to sell his project to 30,000 people.

Mind you I offered to help my friend to renew my skills. I vowed to do a professional job (to the best of my abilities), and did that. But, I sort of feel like I wasted six months of my life developing something, and then redoing it. Only to be told, "Nevermind I bought a book and taught myself."

My friend wrote "bad" code to meet his immediate needs and feels fabulous about it. Why should I bother trying to write professional code when customers feel this way. I suspect non IT managers feel this way too.

What do you think? Oh try not to beat on me too hard.