Monday, April 02, 2007

I've sometimes marveled at how different the code I write today looks when compared to the code I wrote just a few years ago.  Apparently I'm not alone - Scott Hanselman just posted about rescuing his C#-based TinyOS from the doom of GotDotNet, commenting that he was "shocked and offended" with himself after review the code a few years later.  Man, I know that feeling.  Here's the comment I posted to Scott:

Hey Scott, nice new theme! I apparently missed the rollout of it since I usually read everything via my feed reader.

I have to take the bait on your comment about telling you how our five year old code looks. Five years ago, I would have been at Commerce Bank for a little over a year, and hoo-boy, did I write some embarrassingly bad classic ASP and VB in that era. Those first couple years at Commerce were a crash course for me in a lot of things - web technology, pseudo-OOP (realizing that we're talking about VB 6), COM, enterprise development, etc. Five years later, I can say with confidence that this code is amazingly bad; Especially anything where I tried to use XML for no reason other than because it's what the cool kids were doing at the time. Any of the code I wrote in that timeframe should be treated as hazardous material and properly disposed of. Thankfully, the programmers who maintain that application today have long since replaced most of my offending code - except the nifty little VB app I wrote to bridge our contact center softphones to our ASP-based web app via DDE.

Prior to coming to Commerce, my start was as a subcontractor for an independent consultant who had a thing for XBase languages. When I started as his apprentice at the age of 12, it was Clipper. Then FoxPro 2.6 for Windows. Then Visual FoxPro 3.0, 5.0, and, by the time I graduated from college and went to work for him full time, Visual FoxPro 6.0. If I were to look around my home office today, I could probably find some code left over from that bygone era, but that begs the question: Why on Earth would I want to? :)

Tuesday, April 03, 2007 6:38:16 PM (Central Daylight Time, UTC-05:00)
So, if that is the case, the code that *I* wrote in that time should probably be flushed straight down the drain? :) Even back 5 years ago I thought you were a pretty effective programmer, so don't get too down on the legacy code you wrote. Basically, it got the job done at the time, it was written fairly efficiently and effectively, and has stood the test of time, as we both have code still in use, from what I know.

Your post brings up an interesting argument: is the code bad because it is bad technically, or is it good, because it serves its purpose and has generated revenue?
Tuesday, April 03, 2007 6:53:18 PM (Central Daylight Time, UTC-05:00)
It's easy to say "it gets the job done, so it's good enough." And with a lot of the code that you and I have floating around in Commerce, that's the case. I suppose the crux of the problem is maintainability - What about the poor schmo that comes along later to add or fix a minor feature? Worse yet, if he's an entry-level programmer, is he going to learn bad habits?
Wednesday, April 04, 2007 3:00:26 AM (Central Daylight Time, UTC-05:00)
Good thing they'll have you for the next 35 years. :P
Wednesday, April 04, 2007 4:58:23 PM (Central Daylight Time, UTC-05:00)
27. I want to take early retirement at 55. :D
Name
E-mail
(will show your gravatar icon)
Home page

Comment (Some html is allowed: a@href@title, b, blockquote@cite, em, i, strike, strong, sub, super, u)  

Enter the code shown (prevents robots):