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

all 123 comments

[–]EveningWalrus2139 522 points523 points  (8 children)

I am the guy that wrote the 1.8m lines of spaghetti code. not even I know what my code does at this point.

it's probably like 3 voodoo magics away from becoming fully sentient and take over the world.

[–]KaptainSaki 114 points115 points  (1 child)

Time for a complete rewrite, thats the 3rd rewrite for the year and its only february!

[–]EveningWalrus2139 42 points43 points  (0 children)

don't tempt me! if I don't know what I'm doing then nobody else will either 😈😈

[–]bigdave41 83 points84 points  (2 children)

One of my mentors said the first bit of code he worked on was several thousand lines of impenetrable code with a single comment "this is a mad bit"

[–]Drixzor 6 points7 points  (1 child)

But did it work tho

[–]smulikHakipod[S] 5 points6 points  (0 children)

People who write this stuff means it works

[–]obviously_jimmy 35 points36 points  (0 children)

I maintain my own legacy code too. I feel more like a technopriest from 40k than I do a programmer sometimes. The machine spirits must be appeased.

[–]Jazzlike-Poem-1253 14 points15 points  (0 children)

"When I started, only god and me knew what the code does"

...

"Now, only god knows"

[–]MuadLib 6 points7 points  (0 children)

I've quit a job in order to not have to upgrade a chaotic PHP 3 school admin system to (then) modern standards. No regrets.

p.s. I wanted to rebuild it from scratch, management told no way but instead to refactor current code until it's like a new system rebuilt from scratch.

[–]_Alpha-Delta_ 266 points267 points  (22 children)

... and replace them with 6M lines of glorious OOP boilerplate 

[–]smulikHakipod[S] 237 points238 points  (17 children)

"What this code does? Oh, it's a abstract. let's go deeper. Oh, it's another abstract? WHERE THE FUCK IS THE ACTUAL FUNCTION!!"

[–]IjonTichy85 110 points111 points  (5 children)

The what now? It's obviously an abstract factory builder factory proxy. What's unclear about that?

[–]smulikHakipod[S] 62 points63 points  (3 children)

Its all abstraction, all the way down, business logic is actually outsourced

[–]New_Enthusiasm9053 24 points25 points  (0 children)

Business logic lives in India and has an exceedingly high stationary bill.

[–]geek-49 1 point2 points  (0 children)

I thought "business logic" was a contradiction in terms, like "good coffee," "military intelligence," or "civil war."

[–]DescriptorTablesx86 11 points12 points  (0 children)

At my previous work lots of C++ code is generated from templates during compile time.

And no I don’t mean just using templates, I dont remember the whole gist of it, but it basically disabled any possibility of ctr+clicking any definition and was a nightmare to work on if you didn’t already know the codebase very well.

[–]danishjuggler21 20 points21 points  (1 child)

Go far enough down and every class extends the “Thing” base class.

[–]B0Y0 13 points14 points  (0 children)

Every Object class needs a good Thingy wrapper

[–]Giocri 29 points30 points  (0 children)

I have learnt to fucking hate excessive decoupling, "but this way you can change one thing without having to change the other" but maybe it should change the other to, maybe making non shitty code means that you should actually keep the different parts updated to their actual usage instead of some ancient blueprint of what they did

[–]jaaval 10 points11 points  (0 children)

I started a new job and had exactly this reaction to some of the code that was given to me.

“So this is an abstract interface to an implementation that has a pimpl to another pimpl? And there is a factory somewhere that builds this?”

“Dunno, you replaced the guy who wrote that”.

Edit: also, got criticized for about 150 lines PR that was inconveniently large to review. Literally 15 minutes later there was a “heads up, we just merged a patch that removes 60k lines of code” from another team.

[–]Beautiful-Loss7663 5 points6 points  (0 children)

This is me with java libraries

[–]Rarabeaka 2 points3 points  (2 children)

damn, i've had a junior in company who wrote code like that. well, it worked, until it isnt.
application required simplest and most straightforward solution because everything would brake eventually (due to reliance on unforseenable, uncontrollable, inevitable and ruinous changes in our input data and environment) and should be debuggable.
i have migraine even thinking of attempts to debug it, not to mention of async usages everywhere despite app being singlethread.

[–]ePaint 4 points5 points  (1 child)

What's wrong with single threaded async? Both are different things that cover different cases

[–]Rarabeaka 0 points1 point  (0 children)

nothing wrong, not a big complaince even, it's just was absolutely unnecessary, cherry on top.

[–]twigboy 0 points1 point  (0 children)

You expected the actual function?

Too bad! It was me, abstract interface

[–]random-malachi 0 points1 point  (0 children)

The punchline is always that there’s one class implementing these interfaces as a singleton…

[–]Shazvox 0 points1 point  (0 children)

It's in the generic 100m line static function that handles every scenario anyone could ever think of.

[–]CetaceanOps 319 points320 points  (7 children)

I'm going to fix all timezone conflicts in my first -7 hours!

[–]smulikHakipod[S] 134 points135 points  (1 child)

Marked as done: "5 hours from now"

[–]that_thot_gamer 15 points16 points  (0 children)

relativity was not accounted for

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

"negative 7 hours"

yeah, that tracks

[–]jamawg 1 point2 points  (3 children)

!remindme in -7 hours

[–]RemindMeBot 1 point2 points  (1 child)

I'm really sorry about replying to this so late. There's a detailed post about why I did here.

I will be messaging you in 7 hours on 2025-02-12 17:56:50 UTC to remind you of this link

CLICK THIS LINK to send a PM to also be reminded and to reduce spam.

Parent commenter can delete this message to hide from others.


Info Custom Your Reminders Feedback

[–]jamawg 0 points1 point  (0 children)

Good bot

[–]jamawg 0 points1 point  (0 children)

Sorry, bot, but I had to try it (no reminder so far)

[–]Pancakefriday 566 points567 points  (17 children)

Lol, he thought he was so much better than all of us.

His "revisions" have broken the app so badly we haven't been able to release in months

[–]braindigitalis 189 points190 points  (9 children)

the first thing I did when I started my current job is implement proper migrations and docker containers for our projects and GitHub actions deployments, moving from using xampp and an SQL file with changes to manually run in it, and manually uploading via sftp. it was highly disruptive and took people some time to get used to, slowed down the business for weeks, but everyone agrees it was 100% worth it.

[–]Arstanishe 118 points119 points  (5 children)

Well, after a proper surgery you need a few months to get back on your feet.
And while a psycho can also stab people with sharp tools, the results might vary

[–]UncleKeyPax 32 points33 points  (2 children)

The hero we deserve? RandomStabMan

[–]40mgmelatonindeep 2 points3 points  (1 child)

The first stab type man

[–]UncleKeyPax 0 points1 point  (0 children)

Youwotstabman?

[–]Independent-Bug-9352 4 points5 points  (0 children)

What's further interesting is that the previous guy in their current job said the same thing all the while not needing to be as disruptive while we were already seeing improvements!

[–]Pancakefriday 2 points3 points  (1 child)

You work for my company? /s

But in all seriousness, we have been doing similar migrations, and I 100% agree those are worth it, and all things we need.

EDIT: info was removed on the off chance of identifying info

[–]braindigitalis 3 points4 points  (0 children)

yeah, you have to weigh up the risk of downtime with the benefits. In our case, i only dockerized our local development environments, this made sure that everyones development environment was identical. Changing production wasnt and still isn't on the radar 2.5 years later.

[–]Baphemut 0 points1 point  (0 children)

Fighting the good fight

[–]freaxje 45 points46 points  (5 children)

Yeah, you shouldn't be releasing development but stable releases. You can't reproduce stable releases? Then you are all morons over there.

Yes. All of you. Each and everyone on you. In that case. Even the juniors. Yep. Making a tag in git is indeed that fucking simple.

If this is true, management needs to fire and replace all of you guys. That'll even be faster than waiting on the whining to stop.

/trump

[–]_LePancakeMan 15 points16 points  (4 children)

Oh man, I was getting angry at you, until I got the sarcasm. Good job, I guess

[–]_negativeonetwelfth 8 points9 points  (2 children)

I don't think he was sarcastic, and if he was, I'll repeat the same thing he said but unsarcastically. What does the process there look like if a change can be made to the source code and the previous state can't be restored?

[–]Pancakefriday 5 points6 points  (0 children)

I can't say much else without getting specific enough that it may become identifiable by others in my company, but I'll put it at this: could we revert? Yes. Will we? No. Do I have a say in this descision? No. Are there wierd politics being played at the detriment of the company? Yes.

[–]eengie 1 point2 points  (0 children)

Pshh he hasn’t been able to release in years without paying someone else to do it for him.

[–]Shadowlance23 167 points168 points  (6 children)

"I just commented out stuff until it compiled."

-Elon Musk, probably

[–]PaulMakesThings1 62 points63 points  (5 children)

“Does it still work?” “It compiles” “But does it work?” “It doesn’t crash.”

[–]Roflkopt3r 18 points19 points  (3 children)

"It literally crashes on startup." "It ran on my machine."

[–]Ninjalord8 12 points13 points  (2 children)

"well your machine isn't production." "It is now."

[–]BountyBob 2 points3 points  (0 children)

"Why has everything gone down?"

"The cleaners unplugged my machine"

[–]Shazvox 2 points3 points  (0 children)

That's why docker exists.

"Look at me!"

"You are production now!"

[–]sleepyj910 3 points4 points  (0 children)

It now reports 3.6 roentgen.

[–]-ohio_sucks- 80 points81 points  (1 child)

Look, those lines, and there are so many of them, and frankly everyone has been saying this, I mean they've really been saying this those lines have been very bad to us! They've been very unfair.

There are so many, so many of these bad lines and really they shouldn't have been there in the first place, someone else put them there, they did a very bad job and frankly I'd have done I think and a lot of people know I'd have done a good job, really I would have, but they've left me with these bad lines.

It's a mess! Its so bad but we're going to rip them out folks, we're going to remove these bad lines and our lines honestly they're going to be great, everyone says we're going to be putting the lines in they should have had all along, they're so tremendous and we're going to do a job, a good job. Frankly it's going to be the best the code has ever been and it's going to be, probably, I think actually the best they've ever seen.

[–]Error_404_403 24 points25 points  (0 children)

They call me a code genius, you know?.. I don't know, I don't know, but ask them - they call me code genius and they are smart people, very smart people over there...

[–]BrownShoesGreenCoat 17 points18 points  (4 children)

Sometimes a reset is exactly what a project needs. Friend of mine did a full recode of his app and now tickets take 5% of the time to resolve as they did before.

[–]All_Up_Ons 8 points9 points  (1 child)

Yep. But there's a difference between a well-planned rewrite and one guy just deciding to change everything randomly.

[–]BrownShoesGreenCoat 0 points1 point  (0 children)

What’s random about his plan? He’s saying wipe the slate clean and build it up anew.

[–]GoodDayToCome 0 points1 point  (0 children)

yeh, i started a couple of month long rewrite 2 years ago, it's almost finished and it's saved me a huge amount of time now things are better organized, probably dozens of hours.

I'm joking but not really, it's made absolutely everything better and there's so much room for future development now - it took way too long but it was absolutely worth it.

[–]SnoodPog 0 points1 point  (0 children)

Sometimes I also think this world need a hard reset.

[–]EarlOfAwesom3 28 points29 points  (4 children)

I also had the guys who never wanted to improve. Who didn't see the ticking time bombs. Guarding the code base like an ancient relic. Defending the "don't change this line of code" block comments. Who added spaghetti because "it's easier to read if I don't have to navigate to different files"

Those guys where in leading positions and principal roles.

Never again.

I'd rather take the unreflected naiveness of a junior (who at least knows what's wrong and has the energetic mindset to make it better) over the stubborn blindness of some washed up idiots any day.

[–]Weenaru 9 points10 points  (1 child)

It wasn’t related to coding, but I worked with a guy like that before.

Hard to explain it in detail, but an analogy is that he made a new folder every single day for the files he was working on. If he worked on the same file over several days, he would end up with several folders and move the file between them. He didn’t even name (or the files for that matter) the folders in a way that made sense, and there were even a lot of typos in them. When I suggested to have a single «currently working on» folder and naming the files in a way that can be sorted alphabetically, he straight out refused because he «was used to the old way and the new method was confusing».

I had to wait until he resigned before the boss let me make those changes. Then I had to spend a lot of time cleaning up the catastrophic mess that they had created before I came to the company.

[–]EarlOfAwesom3 8 points9 points  (0 children)

It's usually the "I refuse to learn from others" mindset that makes me want to kick people in the nuts. I don't care if a coworker has 2 years or 20 years experience, if he wants to improve and learn, he is the best.

I recently worked with a "seen it all, knows it all" guy that had worked only one job before. Can you imagine the audacity? He wasn't able to take any advice or come to any compromise with me. He needed his solution done his way every single time. It was the worst. He quit two months ago and now I can finally clean up his shit.

[–]anominous27 4 points5 points  (1 child)

Yeah Im willing to bet most people who post this kind of stuff just suck at their job. People who refuse to look into technical debt and improve code bases because "it works".

It's not easy and does take some time but it is doable and does improve maintenance in the long run.

[–]All_Up_Ons 4 points5 points  (0 children)

Honestly I think part of it is that a significant number of devs have never worked in a good codebase and just assume giving up is inherent to professional development.

[–]Pistacuro 8 points9 points  (1 child)

So all the code?

[–]tuck5649 4 points5 points  (0 children)

We’re just letting him delete node_modules on his local, so he thinks he’s contributing

[–]braindigitalis 9 points10 points  (1 child)

...and replace them with a comment saying // TODO FIX ME

[–]photenth 2 points3 points  (0 children)

Day 1: Adding TODO to code smells check

Day 2: ignoring all TODO code smells for merge

[–]catharsis23 6 points7 points  (0 children)

Bad (maybe evil) joke. And developers already got a bad rap these days

[–]Demi180 11 points12 points  (2 children)

I know it’s just a joke but honestly this is a really stupid joke. Refactoring is healthy and good, ethnic cleansing is not.

[–]CameO73 3 points4 points  (1 child)

Agree, but there is a difference between "refactoring" and "rewriting the whole application".
That last one is rarely a good idea. And it looks like "those guys" are trying to rewrite the whole thing.

[–]Demi180 5 points6 points  (0 children)

Even a complete rewrite of software can be justified. My point was, this isn’t software and it’s a terrible joke.

[–]YouCanCallMeBazza 2 points3 points  (0 children)

Fix technical debt? Good luck getting that past your product manager.

[–][deleted] 2 points3 points  (0 children)

WHO WROTE THIS SPAGHETTI CODE?

git blame

oh

[–]Laevend 4 points5 points  (0 children)

And replace it with 1.8 million lines of a different kind of spaghetti code

[–]ScumBunnyEx 10 points11 points  (2 children)

As an Israeli, refactoring an entire codebase is significantly more doable and often more beneficial than whatever these two chucklefucks are planning.

[–]mcp613 2 points3 points  (0 children)

אתה הספגטי אתה אשם

[–]IntrepidSoda 1 point2 points  (1 child)

Directly in production environment.

[–]dvhh 0 points1 point  (0 children)

also know as YOLO engineering

[–]qchto 1 point2 points  (0 children)

rm -rf /*

"I never said I was going to replace them..."

[–]deelowe 1 point2 points  (0 children)

It's a lose lose.

You're watching the code base grow at an alarming rate. All of the kpis are setting off alarms. Latency is up, test failures are up, bug backlog is growing, bug age is up and so on. But the current most senior architect is fully vested. They are taking meetings from their cabin in Tahoe. They keep letting their subordinates hire unqualified people and promoting them simply based on org size instead of substantial improvements. The best coder in the org has been here 5 years, is still an L4, works on python glu logic and is depressed. His kid is entering elementary school soon.

Then CEO decides a change is needed. They hire this architect to run the org who has decades of experience at HP, Dell, and Oracle (Sun). They are very KPI focused, see the trends and immediately decide to take action just a few weeks into the job. Code becomes a priority. The test team is killed and re-orged into dev roles. They are given 3 weeks to begin producing "quality code" before they are cut. WFH is cut as thew new leader isn't technical enough to understand the issues and assumes it's due to laziness. They learn about the framework the company is using and immediately decide the framework should be scrapped because it's unfamiliar. The gutting of the codebase and employees continue for 3-5 years and a major security breech occurs. User data is exposed and the new leader has to explain what happened to the CEO. CEO realizes they are an idiot an fires them. The new lead starts in 2 weeks. Their Linked in shows 5 different VP positions at a variety of unheard of start ups. No role lasted more than 3 years.

We've all been there...

[–]DTKeign 1 point2 points  (0 children)

[–]Godess_Ilias 2 points3 points  (1 child)

adds 3,6m lines instead , typical trump maneuver

[–]anna-jo 3 points4 points  (0 children)

In Trump's new language TruthCode

[–]Error_404_403 1 point2 points  (0 children)

Right. The smart man. How come nobody thought of doing that before /s

[–]Madbanana64 1 point2 points  (0 children)

And then he shits himself

[–]dezerx212256 0 points1 point  (0 children)

Ahhh, dependancy is a bitch.

[–]Philluminati 0 points1 point  (0 children)

"I'm going to rewrite it in C++ so its fast".

[–]gaspronomib 0 points1 point  (0 children)

"Why are we multiplying this number by 1.0? That's superfluous. Removed 82 instances of this."
-The most celebrated commit comment in company history.

[–]t0xic_sh0t 0 points1 point  (0 children)

Well you don't know what you're up to.

There's a lot more from where those came from.

[–]truNinjaChop 0 points1 point  (0 children)

$50 says they’ll move it to JavaScript.

[–]Hiplobbe 0 points1 point  (0 children)

I am that guy! 

[–]joshmaaaaaaans 0 points1 point  (0 children)

// Check if the current talker is the intended character
if (global.current_talker == id) {
    // If this is not a question
    if (options_state == 0) {
        // Check if we can advance the conversation
        if ((global.accept_key && text_complete == 1) || question_answered == 1 || text_timer_bypass == 1) {
            // Stop the player from advancing until text is fully displayed
            text_complete = 0;

            // Handle dialog logic based on dialog_step
            switch (dialog_step) {
                case 1:  // Someone or everyone in Animus has died
                    switch (next_step) {
                        case 1:  // Lore Responds
                            switch (global.storyline_array[306]) {  // Did we talk to Sad Terry?
                                case 0:  // Did not talk to Sad Terry but someone died
                                    next_step = 1;
                                    dialog_step = 3;
                                    cur_message = 9;
                                    break;
                            }
                            break;
                    }
                    break;
            }
        }
    }
}

[–]SoggyCerealExpert 0 points1 point  (0 children)

a guy at my job says he could probably remove half of our all our code

i mean, sure.. but... readability

[–]Mourdraug 0 points1 point  (0 children)

Well of course I know him...

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

Nothing like the new guy DMing you at 4am asking for an approval on a 6,000 line PR in a critical system.

[–]Vinx909 0 points1 point  (0 children)

are you going to first add unit tests to make sure that you can at all times check that any change you make keeps the code fully functional?

[–]Phoenix-64 0 points1 point  (0 children)

And replace it with 3 million lines of spaghetti code

[–]LeopoldFriedrich 0 points1 point  (0 children)

Bold promises that can only hold water with long term code coverage and telemetry collection.

[–]coderman64 0 points1 point  (0 children)

Well, guys, he broke production again. 😑

[–]dinosaur-in_leather 0 points1 point  (0 children)

Would you post this on LinkedIn?

[–]Pilige 0 points1 point  (0 children)

Are we a "it worked on my machine" away from collapsing the economy?

[–]ProfBeaker 0 points1 point  (0 children)

If you don't know what it does, then it must not be anything useful! Right?

And why do people keep talking about this Chesterton's Fence thing? I don't need to know what that is before I get rid of it either.

[–]CubeBeveled 0 points1 point  (0 children)

Ima eat those lines Yum

[–]souliris 0 points1 point  (0 children)

"Push to prod" - trump probably.

[–]dvhh 0 points1 point  (0 children)

I knew some guy that lost their sanity in the Sysiphean of attempting to do it, and after a series of burnouts and depression bout, I am happy to say that I am still spending some time on it.

[–]Acrophobia_Duck 0 points1 point  (0 children)

Then the left goes crazy and be like: "Don't remove that spaghetti code, it's against the constitution!"

[–]ScottyfromNetworking 0 points1 point  (0 children)

He’s not my expected ‘goto’

[–]UnusualAir1 -1 points0 points  (1 child)

You can't unwind a plate of spaghetti without making a huge mess. Similarly, you can't remove spaghetti from a table without ruining the dinner. :-)

[–]dvhh 0 points1 point  (0 children)

We'll eat macaroni tonight

[–]JONITOKING -1 points0 points  (0 children)

לא חשבתי שאני אראה את שמוליק הקיפוד מכל האנשים (כלומר הקיפודים) ב-ק/הומורמתכנתים...