Article 5BAV8 Mandatory Confusion

Mandatory Confusion

by
Jane Bailey
from The Daily WTF on (#5BAV8)

512px-Mighty_gnarled_tree_%28Unsplash%29

CorpCo was a small company; it consisted of Tymeria, the president, and two programmers, Kylie and Ronnie. Kylie had seniority, having been working there for 6 or 7 years, but Ronnie, our submitter, had been working there a hefty 4 years herself. The company purchased a legacy VB web app from a client company, AClientCompany; AClientCompany had been working on the app for 15 years, with their lead programmer Michelle as the sole programmer. The app had been written in classic ASP using VBScript, though at some point Michelle had begun converting the project to ASP.NET with VB.NET. (Did you know you can mix and match classic ASP with ASP.NET and classic VBScript with VB.NET in the same solution? I didn't!). Of course, the app was riddled with security vulnerabilities, copypasta, and spaghetti code. One main class, called DBFunctions.vb, was over 30,000 lines!

Fast forward to September 2019, shortly after CorpCo took over. The application involved multiple forms that customers had to fill out, some of which had customizable fields that the users could adjust on the fly. All of this was stored in a SQL Server database, hence DBFunctions.vb, the functions needed to pull data out of the database and render the forms for customers to enter and/or edit the forms by the internal users. A feature request came in to be able to mark some of the additional fields mandatory for completing the form: pretty basic stuff for a forms editor at heart. Ronnie wasn't familiar with the code, so she budgeted 13 story points, or just under a week.

Before any of us dig into the code behind a project, we have certain basic assumptions about what we're going to find. Probably, form fields are stored in the database. Probably, there's a table for additional fields to which Ronnie could add a column in order to mark the field mandatory or optional. Probably, there's some identifier that marks the field as belonging to a specific form, and maybe even one for the order in which the questions go on the form so that order can be preserved. You know. Normal stuff.

If those assumptions held up, we wouldn't be running this story, would we? As it turned out, instead of one AdditionalField table in the database, there were about 20 of them, one for each question type in the system. Why had Michelle done it this way? When Ronnie shot her an email, she replied sheepishly that she was concerned about the table getting to be "too big." "We don't want to get into big data territory," she said, proving that she knew nothing about big data and very little about databases.

But whatever. Ronnie added a Mandatory column to each of the tables, updating all the SQL queries that were hardcoded inline without parameterization in the DBFunctions.vb file. Then she added a checkbox on each of the additional field edit screens, one for each type of question. She added JavaScript validation to the fields, though some of them (the checkbox lists in particular) didn't play nice with jQuery's validator, so she had to add custom code for those boxes. So finally, she finished, sat back, and ran the program to do her basic developer sanity checks.

And ... it didn't work. The checkbox showed up, but checking it seemed to do nothing.

Her code was still all in a branch at this point, so she wasn't holding anything up by fiddling with it. So she spent the rest of the week fiddling, trying to figure out what she missed. But it still wasn't quite working. She asked Kylie to look at the code, but Kylie had literally never used VB before, having been primarily a C#.NET developer. She asked Tymeria, but she was too busy with other projects to spend much time looking at it. So there wasn't much help to be had.

And so the branch just ... rotted.

It's now the end of 2020, over a year since the feature was requested. The branch is still languishing, rotting away. There's only a few bugs at this point, but nobody's able to quite figure them out and there's no more help to be had. There's been numerous other bug fixes and feature requests, and the code's been cleaned up a bit and a refactor is in the works. There's even an experimental branch where they imported a bunch of C# code to replace some of the worst bits of VBScript. But this branch is still sitting out there, languishing. Will CorpCo ever finish the feature request? Maybe.

Probably not. But maybe.

Only 3 days left before the auto-closer closes the ticket as "stale" ...

proget-icon.png [Advertisement] Keep the plebs out of prod. Restrict NuGet feed privileges with ProGet. Learn more. TheDailyWtf?d=yIl2AUoC8zAaJI-qJscEm0
External Content
Source RSS or Atom Feed
Feed Location http://syndication.thedailywtf.com/TheDailyWtf
Feed Title The Daily WTF
Feed Link http://thedailywtf.com/
Reply 0 comments