Long time schadenfreude enjoyer, first time provider.
Third time attempting to post. First was too ranty, second disappeared into the aether. My bad.
Some explanation. Bossman is a Classic ASP cowboy (nothing against the language, just the way he used it). Variables with less than three character names, recursive functions (that only ever get executed a max of twice) containing nested case statements, and vomiting code at production until the bits align.
We're starting a new project, of which I'm basically the only dev. We're technically cross-training but everyone wants to train on anything but this. Aforementioned bossman "helpfully" pre-pseudocodes the logic that I'm meant to implement. Variable names are pretty much mandatory and this guy is gleefully ignorant of our tech stack so the general program flow will probably have to remain. This is a small segment surrounded by hundreds of lines of the same, all typed into a Jira comment.
if "cp" = "jv"
if "ev = "lo" and ("to" > n seconds since temporarytime OR there's an item in "vo" already AND there's a referrer AND the host from the referrer != "hn"
increment actionsintended
If "vh" from the last entry in the array != to the value of "hn" in this record or there are no items in "vo"
use the value from "hn" as "vh", and the value from "to" for "tv", "sv = "sv", "sf" = "sf", "fv" = "fv"
If there's an item in "vo" already
set "ap" = true on this object
increment actionsintended
If "vh" from the last entry in the array = to the value of "hn" in this record
Set the value of "in" in the last entry to true
If "ia" = "aj"
Store the time from this record temporarily in temporarytime
Two notes:
x != to ...
does not meanx != {{variable named "to" used a few lines previously}}
str_1 = str_2
means "str_1 and str_2 are keys in two separate hashes. Compare the values. Determining which hash the keys are in is left as an exercise to the reader, and the order will change throughout."
The translation of that pseudocode is quite literally what I feel is the worst code I've ever written, and I'm not sure if I have a valid argument anymore or if I'm just . This sentiment stems from more than just this pseudocode. Another place, another time.
Anyone wants more info to laugh at/mock me with, ask and I will anonymize and provide.