DevDisasters

The Logic Behind Modern Maintenance

When the big merger was announced, the IT staff of both corporations was a little bit nervous, and with good reason: The day after the announcement, many redundant positions were eliminated. Miraculously, the IT staff on both sides was left almost untouched. With the integration of two disparate code bases, there was a lot of work ahead.

The Odd Couple
During this process, Doyle discovered that his development group inherited a widely used enterprise-level suite of Visual Basic 6 client-based apps from "the other side." Doyle and his team were used to working in VB.NET, C# and ASP.NET; they felt a little taken aback at this news. But no matter, they thought -- it was only Visual Basic.

So, after procuring enough copies of Visual Studio 6.0 from various online auctions for the entire office, and applying 10-plus years worth of updates, they were ready to get their integration show on the road. They were just in time, because enhancements were rolling in by the truckload.

Doyle needed to add another country-code checkbox for Mexico to a user configuration screen. It turned out that the program got data about what company information a user could view by reading in a registry entry (a three-bit field):

If iChkBx And 100 Then chkUS.Value = 1 Else chkUS.Value = 0
   If iChkBx And 10 Then chkCanada.Value = 1 Else chkCanada.Value = 0
   If iChkBx And 1 Then chkOther.Value = 1 Else chkOther.Value = 0
 
   'If not visible then uncheck in case it got checked above.
   
   If chkUS.Visible = False Then chkUS.Value = 0
   If chkCanada.Visible = False Then chkCanada.Value = 0
   If chkOther.Visible = False Then chkOther.Value = 0

After some inspection, it was found that many UI input controls were controlled by this "bits in the registry" method.

To the developers who maintained the application before the merger, this was how they did things; but to those in Doyle's department, this method -- though functional -- made them cringe. They knew they could do it better. After all, with all the enhancements coming, they would be allowed to make improvements along the way, right?

Wrong.

"Hold on!" declared the project leads. Enhancements, like adding a new checkbox, were completely valid. But changing existing base logic -- no matter how flawed -- added risk to a process that, up until a few weeks prior, never needed to take into account that "other" might not suffice as a category for users residing in Mexico.

Hooray for Status Quo
In the end, the original caretakers of the app didn't feel too bad about this decision. They could go ahead and keep up the programming habits that they'd honed during the past decade. Now, Doyle and his team spend their time adding and swapping bits in the registry, learning the "other" way of doing things, and biding their time until the merger train pulls out of the station.



About the Author

Mark Bowytz is a contributor to the popular Web site The Daily WTF. He has more than a decade of IT experience and is currently a systems analyst for PPG Industries.

comments powered by Disqus

Featured

  • Compare New GitHub Copilot Free Plan for Visual Studio/VS Code to Paid Plans

    The free plan restricts the number of completions, chat requests and access to AI models, being suitable for occasional users and small projects.

  • Diving Deep into .NET MAUI

    Ever since someone figured out that fiddling bits results in source code, developers have sought one codebase for all types of apps on all platforms, with Microsoft's latest attempt to further that effort being .NET MAUI.

  • Copilot AI Boosts Abound in New VS Code v1.96

    Microsoft improved on its new "Copilot Edit" functionality in the latest release of Visual Studio Code, v1.96, its open-source based code editor that has become the most popular in the world according to many surveys.

  • AdaBoost Regression Using C#

    Dr. James McCaffrey from Microsoft Research presents a complete end-to-end demonstration of the AdaBoost.R2 algorithm for regression problems (where the goal is to predict a single numeric value). The implementation follows the original source research paper closely, so you can use it as a guide for customization for specific scenarios.

  • Versioning and Documenting ASP.NET Core Services

    Building an API with ASP.NET Core is only half the job. If your API is going to live more than one release cycle, you're going to need to version it. If you have other people building clients for it, you're going to need to document it.

Subscribe on YouTube