A project with a single 11,000-line code file

Austin Z. Henley I work on dev tools. 4/3/2022 Image based on obligatory XKCD comic. A long time ago at one of my first software jobs, I received a bug report for a internal product that I didn’t even know existed. It turned out to be an application that serves up basically every form that…

46
A project with a single 11,000-line code file

Austin Z. Henley

I work on dev tools.



4/3/2022

Image basically basically based entirely on mandatory XKCD comic.

A prolonged time ago at one of my first tool jobs, I bought a trojan horse characterize for a inner product that I did now not even know existed.

It became out to be an software program that serves up on the full every derive that any employee inner the corporate would possibly possibly perhaps well need. If truth be told a take-all resource. Elevate out it’s some distance crucial to characterize any individual to HR? There is a derive for that. Elevate out you wish a contract for a peculiar client? There is a derive for that.

The accountability of declaring the project had been bounced from personnel to personnel over time. It appears it belonged to my personnel. And by my personnel, I mean me.

Oh, the dismay.

It modified into once a single code file with over 11,000 traces of VBScript.

Countless folks had made adjustments to this file over time. Nonetheless they did no longer appear to be tool developers. Their roles ranged from IT enhance to trade analyst. I’m unnerved at how runt rate the project modified into once given pondering what number of workers used these sorts on daily foundation.

It seemed care for the full file would carry out via from prime to bottom, though I never basically confirmed it. The code followed a tough pattern of derive some info in regards to the particular person, study if some prerequisites are met, then enact some action which repeated a thousand or so situations. The necessities were normally as straightforward as:

If (usrrps=5) And (wauth "") Then

What got here next modified into once usually a combination of showing a derive, accessing a file on a shared drive, working a SQL depend on on who know whose database, and sending an email to a hardcoded tackle.

Now, I had never used VBScript sooner than (and have not since then), nonetheless many variables gave the look to be unused. The names were indecipherable. Synonyms were littered at some level of.

One thing I came throughout hilarious is that a variable will be used on traces 200-210 and nonetheless on line 8544. No the derive else.

Noteworthy of the good judgment looked redundant. Presumably reproduction and pasted at some level then later diverged. Cherish, how over and over does the particular person wish to be authenticated in a single code file? Once I dared to stunning this up and reuse the authentication response, nonetheless it completely broke the entire lot. I never figured out why. To in this level in time I continuously lie in bed questioning what would possibly possibly perhaps well have resulted in this.

There modified into once no version alter. The appropriate context about code adjustments modified into once in the trojan horse tracker and in the code comments, though I learned the laborious advance to no longer have faith these.

There modified into once no take a look at environment. If I made a trade, I needed to verify it in “production”. The complete program’s enlighten modified into once basically basically based entirely on the particular person’s privileges so we would impersonate whoever reported the trojan horse such that lets watch what they noticed.

There were no unit tests. If I made a trade that resulted in some assorted “feature” to interrupt, there modified into once basically a 0% chance I’d know about it till per week later when Jeff in marketing would characterize a trojan horse.


What’s the finest of the memoir?

  • Customers set no longer care in regards to the applied sciences or code.
  • Builders enact care.
  • Technical debt is real. And it’s some distance at possibility of be costly.
  • The ingenuity of folks is amazing.

I have no idea.

Read More

Vanic
WRITTEN BY

Vanic

“Simplicity, patience, compassion.
These three are your greatest treasures.
Simple in actions and thoughts, you return to the source of being.
Patient with both friends and enemies,
you accord with the way things are.
Compassionate toward yourself,
you reconcile all beings in the world.”
― Lao Tzu, Tao Te ChingBio: About: