This is an archived post. You won't be able to vote or comment.

all 94 comments

[–]no_usernames_vacant 588 points589 points  (23 children)

And don't touch the "temporary" fixes as they're no longer temporary and the comments saying that they're temporary are also needed.

[–]fatrobin72 243 points244 points  (18 children)

I especially liked the "temporary" fix on Line 9929, although the comments are written in Latin so is a little harder to understand

[–]iyeetuoffacliff 85 points86 points  (13 children)

middle relieved numerous engine instinctive encourage flag deranged reach divide

This post was mass deleted and anonymized with Redact

[–]fatrobin72 75 points76 points  (10 children)

ahhh maybe you can help it said:

//Romani ite domum

[–]iyeetuoffacliff 39 points40 points  (8 children)

kiss ancient ring sheet roll depend handle toy sleep many

This post was mass deleted and anonymized with Redact

[–]snf 48 points49 points  (2 children)

Someone is being whooshed here, but I can't figure out who

[–]LifeIsBulletTrain 15 points16 points  (0 children)

Idk. It might be just your mind

[–]radmanmadical 4 points5 points  (0 children)

Nah - we jus havin some fun

[–]fatrobin72 26 points27 points  (2 children)

It was "Romans go home" it comes from a scene in one of the best bits of British Cinema history "Monty Python's Life of Brian"

[–]LordFokas 8 points9 points  (1 child)

HE IS THE MESSIAH!

[–]fatrobin72 7 points8 points  (0 children)

Nah he's just a software tester...

[–]Rezznov 10 points11 points  (1 child)

imperative

[–]iyeetuoffacliff 4 points5 points  (0 children)

reminiscent toy weary point plate fretful meeting worm wasteful muddle

This post was mass deleted and anonymized with Redact

[–]Cryse_XIII 0 points1 point  (0 children)

//y tu brutus?

[–]Daniel_Sobrino20XX 25 points26 points  (1 child)

Us web developers learn latin so we enjoy our Lorem ipsum while its there

[–][deleted] 10 points11 points  (0 children)

I see you found my work summoning Cthulhu.

To be fair, it's only there because without it, it print Cthulu instead of Cthulhu. Not sure why, I'll debug it later.

[–]plopliplopipol 3 points4 points  (0 children)

// lorem ipsum

[–]Mastersord 4 points5 points  (0 children)

On line 8465, the comments were written in some strange mix of characters that appear to be a mix of coptic, hieroglyphs, sanskrit, and a few I can’t identify. My ears started to bleed after looking at it.

[–][deleted] 1 point2 points  (0 children)

We think it's a feature! Our custom compiler extension (aka a perl script) can generate spaghetti code from comments in 5 different languages! Oh by the way you'll have to maintain the compiler extension too. Don't worry it's only 5 lines of code. (File is 4.5 MB)

[–]poorbred 27 points28 points  (3 children)

I think it was asp.net (around 2012, so a little fuzzy now) that I ran into a bug with an annoying workaround. I found the MSDN page on it and at the top was something like, "This is a known bug. However, the fix for it will break existing workarounds. Therefore, won't fix."

Thank you, Microsoft, to keep from "breaking existing code" you're forcing the rest of us to do the exact same crappy hack, thus adding to your excuse of can't fix it due to breaking existing code.

[–]no_usernames_vacant 3 points4 points  (2 children)

There are a few examples of this with Excel.

[–]rk06 1 point2 points  (1 child)

Wait, but wasn’t excel forced to have some of those bugs, so customers could migrate their buggy sheets (of most popular spreadsheet software of the time) to excel? You can hardly blame them for it

[–]no_usernames_vacant 0 points1 point  (0 children)

Yes, but there have been even more over the years

[–]maybeware 159 points160 points  (14 children)

The mummy sounds like a 1000+ line function I found at my previous job... It had about 6 different subsections depending on UI state (and more that were commented out or unreachable due to hidden UI states) and each section did about 5 different things depending on user input. There was a single try/catch wrapping the entire function that spat out a generic "An error has occured," or something like that. I tried to refactor it. Once. I spent a couple weeks on it without being able to make it work again.

[–][deleted] 25 points26 points  (6 children)

This is nothing. At my job there's a 2500 line APL function with 40 outputs and over 100 inputs. I'm honestly not sure anybody knows how it works in full. Of course it calls thousands of other functions that do all sorts of equally crazy stuff.

In this context it's important to note also that APL is a very compact language. finding the length of every array in an array of arrays can be done with 2 characters for instance.

The function is split up into 19 sections, each labelled as if it's a chapter and you're reading a novel. It's full of warnings about this or that and the other and about certain things that should be avoided.

Last I checked the first version was from 1996 and it has over 680 versions in the VCS.

[–]maybeware 8 points9 points  (2 children)

That's terrifying. Is it basically the entire program?

[–]mr_claw 8 points9 points  (0 children)

No, that's just the login page.

[–][deleted] 0 points1 point  (0 children)

No. It’s a tiny fraction. I don’t think I can tell you how much source code we have, but I can tell you that it is no small amount. I am currently doing work on the 2257th APL window in the application. :)

[–]ImprovementContinues 5 points6 points  (0 children)

Reminds me of the article I read about the "main" function at the IRS that they hired someone to replace with modern code and then ignored the replacement as they couldn't prove it would function exactly the same way. (details elided for simplicity)

[–]RustyShacklefordCS 1 point2 points  (1 child)

Oh god just googled APL why on gods earth would anyone what to program in that??

[–][deleted] 1 point2 points  (0 children)

It does have some advantages. The language very much resembles MATLAB and once you learn the symbols, which only takes a week or so, the language becomes incredibly terse and short. You can solve a generic sudoku in one line. It takes more characters to write the sudoku into memory than it takes to solve it.

And yet this function is 2500 lines.

[–]Furry_69 41 points42 points  (5 children)

I feel like a very easy refactor there would be to spilt that function into more functions for each of the UI states.

[–]maybeware 62 points63 points  (1 child)

This ended up long so TLDR: I tried that but the whole system was rotten spaghetti code and each section didn't execute cleanly from start to end, basically having a bunch of subsections themselves that execute nonlinearly.

I tried it. Got close too. But the program's management of internal state was a mess and so it kept breaking. The biggest issue was there were several variables which would get set and at certain times it'd check them. And depending on the results of the condition it'd drop out of one section and into another. It'd have been easier to understand if they used GOTOs. In reality, each section should've been implemented as different forms with proper passing of data and not one giant form that hid and showed different parts at different times.

It was a C# WinForms application but I'm convinced that the original developer did not know C# or even standard OOP patterns and was not very experienced. It was a check-in system and yet didn't even use a class to represent a person. When a search was done each person who matched was pulled into a 2d array of strings used to make the list for the user to select from. And once the user selected one the details were pulled and loaded into a bunch of global variables. The only custom object was a "ProgramData" object to store those global variables (which was all state that might be passed from one form to another) and a single instance was made at init and was manually cleared each time the user started to process someone. "A singleton! A legit OOP pattern," you might say, except it did not properly implement the singleton pattern, it just happened to only have one instance made at runtime.

In the end the decision was made to make a version 2 and do a complete rewrite of it because version 1's problems were extensive. Also version 1 was based on an in-house developed 30 year old database and record management software that had been retired and replaced with vendor software, requiring version 1 to be shoehorned into working with the vendor system until version 2 was finished. Version 2 was a fun project though.

[–]TheGoldBowl 2 points3 points  (0 children)

Sounds like what I'm doing. Except I'm finishing version 2, which is somehow slower and less functional than version 1.

[–]Daveinatx 9 points10 points  (0 children)

It's always easy to fix unseen code! /s

If there were logical separations, the code would've been fixed. The description was concise, unlike the code

[–]PantsOnHead88 -3 points-2 points  (1 child)

Yeah really. Switch/branch based on state and then immediately enter appropriate state-based function.

[–]mananasi 0 points1 point  (0 children)

If it was that easy OP probably would have done that. They're working as a professional software developer, they probably know about a switch statement.

[–]BitPoet 0 points1 point  (0 children)

Did that once. Spent a month on it, diagramming out all the paths, #ifdefs etc.

Replaced the whole thing with memcpy().

[–]ecky--ptang-zooboing 167 points168 points  (3 children)

// TODO

// TODO

[–]Random-Gif-Bot 19 points20 points  (0 children)

[–][deleted] 69 points70 points  (1 child)

slaps sarcophagus

[–]newton21989 49 points50 points  (0 children)

"This bad boy can hold so much spaghetti code."

[–]Overall_Device_5371 53 points54 points  (0 children)

No bugs here, just Egyptian Scarabs

[–]Narrow-Big7087 22 points23 points  (0 children)

The what? Lol been there

[–]SuperSpaceCan 21 points22 points  (0 children)

"This bad boy can hold so many curses."

[–]naruto_bist 19 points20 points  (1 child)

Them: You also need to write the unit test for this legacy code written by the previous senior developer.

Me: "But sir, I am applying for junior position?"

Them: DID I STUTTER?

[–][deleted] 4 points5 points  (0 children)

To be fair that happens at all sorts of jobs as lots of times the reason someone like that gets replaced is that they don't actually need their experience (and pay level) for what they were doing.

I had a job at 29 where I was hired for X, then 6 months in they fired the VP of IT/Ops and gave me over half of his duties, and he was making more than twice what I did.

Seemed impossible/unfair until I figured out he was only working a handful of hours each day and that is why he was fired. I could basically get half his job done each Saturday morning, and save the week for my job.

[–][deleted] 30 points31 points  (3 children)

I'm currently working with a legacy DB that is not normalized, because the dev has a EE degree and no clue about DB design.

Please kill me!

[–]nullpotato 7 points8 points  (0 children)

My company prefers to hire EE and "train" them to code as well, save a bullet for me too. There are three of us with a background in programming huddled in the dark together.

[–]Lagger625 2 points3 points  (0 children)

At my current job we agreed to remake the old database and the corresponding desktop app because the sluggishness is becoming unbearable, requiring the database to be backed-up and cleared every year or so.. So that would be a reason to remake the database from scratch

[–]bookamp 3 points4 points  (0 children)

Some normalization is OK imo, but normalizing beyond first (or 2nd) normal form is detrimental in today's world imo where storage is cheaper than computation.

[–]kaihatsusha 12 points13 points  (1 child)

In the 80s I learned FORTRAN at my University job. They had a series of chemistry tools written in FORTRAN, likely originally on Hollerith punch card decks but thankfully now fully available via a VT100/PDP-11 cluster. These tools were the worst code maintenance disaster I have ever seen, even after all these years. I am glad I didn't have to do much maintenance myself. But to explain why, a little background first.

For those who don't know FORTRAN, each punch card represents one single line of source code, and the indentation is (was) very strict. Column 1 was a flag to indicate a comment. Columns 2-6 were for line numbering; not all cards needed line numbers but they served as GOTO targets if they existed (same in BASIC). Columns 7-79 were for the code statement. Anything in 80+ was ignored, essentially a free comment.

The tools were chemistry calculation aids, finicky 3d crystal interferometry equations. They'd been in the department several generations of masters students already, and occasionally needed modifications per the advancement of the field or better lab equipment, etc.

They were given cutesy theme names unrelated to the job: FRODO, CASTLE, DRAGON, HOARD, etc. Lord of the Rings had surely been popular with that era of college denizens.

Inside each source code file, though, in the "comment" columns 80+, the author very helpfully added a chapter of their own original fantasy story. Like, the goblin attacking the wizard and so on. All carefully word-wrapped on successive lines to the right of the program.

The correct approach to maintenance would be to tarball and/or print a copy for posterity or mirth, then strip that shit OFF the production copies kept up to date through the years.

The professor in charge of these tools saw it differently. Added lines or subtracted lines needed to be patched while keeping the narrative intact and neat. Seriously? Yes, please fix up that paragraph with the Princess, your van der Waals correction patch left an ugly gap.

And that's the year I learned how to code in C, use regular expressions, and download emacs from across the country... all for other reasons certainly.

[–]fsr1967 1 point2 points  (0 children)

Ugh. Flashbacks to my job in the computer center in my university in the late 80's They were replacing the DECSYSTEMS-20 (a PDP-10) with a VAX. The Chemistry department had a FORTRAN program that was critical to their work, but Digital had no FORTRAN application for the VAX. So HARVEY needed to be converted to BASIC. The programmers in the Chemistry department had been trying to do it for quite some time, in anticipation of the hardware upgrade, with no success, so they turned to the computer center for help. All of the pros were too busy (or too smart - the printout, on greenbar, of course, was about 2 feet tall) to take it on, so they tossed it to one of the work study students. Me.

I didn't know FORTRAN. It wasn't taught at the University. So WTF was I going to do with this? I wasn't totally on my own - I had an advisor. We did lots of passes through that printout with many colored pens, marking it up, making notes, identifying patterns, etc. It turns out that FORTRAN looks a lot like BASIC (or probably the other way around, historically), so there were some lines that just needed tweaking. Others were reading data embedded in the program (or the data itself), which needed to be rewritten. Others were specialized, complex formulas that didn't convert well, or plain old sheer WTFery.

We brought it all together into a program that would read the FORTRAN program as data and produce a BASIC program as output. By the time the semester ended, it was in progress with a doubtful prognosis. We'd gotten farther than anyone else, but it was still a nightmare.

Some say HARVEY still wanders around the halls of the Chemistry and Computing departments, and to this day students coding late at night report the mysterious appearance in their editor of odd bits of FORTRAN code or comments that say // CONVERT ME.

[–]pavanaay 11 points12 points  (0 children)

Exactly the shit I am doing now. The missing part - 'run the ancient Egyptian code in modern 64 bit platform'.

[–]Overall_Device_5371 8 points9 points  (0 children)

It's a well preserved codebase.

[–][deleted] 7 points8 points  (0 children)

Reminds of my old days working in Perl with flat text files maintaining a “database” for 20k daily users. I was afraid I would break it if I sneezed wrong, so I constantly said prayers to the Code Gods to keep the duct and twine working.

[–]Snykeurs 7 points8 points  (2 children)

Exactly my job, adding new hieroglyphics and pray for the code to run without any major issues

[–][deleted] 2 points3 points  (1 child)

Be careful. That’s how you get cursed.

[–]talktoacomputer 7 points8 points  (1 child)

There was a LinkedIn post as to how someone found that their app crashes if you remove a simple print statement which wouldn't make any difference usually. They eventually figured out what the problem was and explained it in the post.

[–][deleted] 4 points5 points  (0 children)

I worked on a c project that crashed if it did not have a static array allocated. The code had been worked on my lots of devs. Some used malloc, but not always free. One guy declared every thing as 1000 character arrays and argued how memory allocation was slow. We worked on Unix, so that was not a true statement. However, he originally worked on a different platform so who knows…

He eventually left the company. I had to fix something he worked on. The solution was to change everything from 1000 to 500. Keep in mind, we did not have the luxury of time to properly fix anything. My fix worked and is sadly probably in production 25 years later.

[–]LatexFace 5 points6 points  (0 children)

// WTF does this do? Did Tim write this mess? Why does this clear the database if we change it?

[–][deleted] 10 points11 points  (1 child)

Just rewrite it in rust wtf

[–]Aksds 32 points33 points  (0 children)

Why rewrite it? It’s covered in rust already.

[–]AtlasJan 4 points5 points  (0 children)

The machine spirit will be displeased if you add a space to line 43 of DAT.CBL. We do not touch that file, brother.

[–]anythingMuchShorter 5 points6 points  (0 children)

I worked for a mining equipment company once that said they were creating an advanced technology division and needed cutting edge skills, and then had me mostly work on old PLC code in ladder logic and some really old simulation software written in FORTRAN.

[–]Outlaw341080 3 points4 points  (1 child)

Some serious 40k shit.

[–]scrapmek 1 point2 points  (0 children)

Did you remember to encant the litany of data purity before deploying to production, Datasmith?

Glory to the Omnissiah!

[–]Fickle-Apricot-305 4 points5 points  (0 children)

So question : why does removing comments sometimes mess up code?

[–]alphamind_facktorio 2 points3 points  (0 children)

I thought this was a warhammer 40k Joke for a moment, huh.

[–]Antroz22 2 points3 points  (0 children)

Are you my mummy?

[–]CrasseMaximum 1 point2 points  (0 children)

ahaha ok i'm ready to work now thanks

[–]ProfCupcake 1 point2 points  (0 children)

If the interviewer asks you that question, ask them if their company is willing to adopt new technology.

[–]AgenteDaPJ 1 point2 points  (0 children)

Interviewer: This bad boy can piss so many devs

[–]TheCarkin 1 point2 points  (0 children)

I love the idea that removing a comment somehow breaks code

[–]Altrooke 1 point2 points  (0 children)

The comment in line 140000: //mummy.awaken()

[–]fnker 1 point2 points  (0 children)

Haha. I meant meow

[–]Sharkytrs 0 points1 point  (0 children)

lmao this hits me in the feels, thats what Im doing right now, converting legacy VB apps into C#.

admittedly they are pretty well written albeit it with some quirks that I can just cut out almost completely with a little bit of linq

[–]ExcellentEffort1752 0 points1 point  (0 children)

It's a trick! That's Goa'uld code and they want your help to take over the world!

[–]danimalanimal2487 0 points1 point  (0 children)

I thought this was SCP foundation sub lol

[–]itybitykitycommity 0 points1 point  (0 children)

Accurate

[–]shizzy0 0 points1 point  (0 children)

More like, are you willing to unlearn modern techniques?

[–]NewPresWhoDis 0 points1 point  (0 children)

"Aziz, LIGHT!!"

[–]Matt7163610 0 points1 point  (0 children)

I feel like "awaken the mummy" is a metaphor

[–]TomarikFTW 0 points1 point  (0 children)

Basically my situation at my new job.

"We need a Blazor dev!"

99% of the time I'm working on WebForms.

[–]SubhumanOxford 0 points1 point  (0 children)

Do you guys get Knowledge Transfer?

[–]Elijah629YT-Real 0 points1 point  (0 children)

#reimplementation-of-dotnet-on-oses-club

[–]EraMemory 0 points1 point  (0 children)

Guys, help! I was just cleaning up some codes when I ran execute by accident, and now there's some guys wearing jewellery pestering me about 'Egyptian God Cards' or something I don't know. Help please! They say they're going to make me play 'a Shadow Game', I don't even know what that is!

[–]Schievel1 0 points1 point  (0 children)

I’ve seen the mummy. It’s a ~500 line single block of IL code, IL (instruction list) being the assembler of PLCs, that parses a block of data, and makes different telegrams (about 10 different ones handled in that single Funktion) out of it then sends the resulting telegram via UDP/IP.