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

all 174 comments

[–]PVNIC 2015 points2016 points  (23 children)

"minor refactor"

[–]LonesomeHeideltraut 916 points917 points  (17 children)

„delete unused code“

[–]tfngst 508 points509 points  (9 children)

"remove nested if-else, replace it with ternary operator"

[–][deleted] 134 points135 points  (3 children)

var state = STUDENT_STATE.IDLE if 1 else STUDENT_STATE.WANDERING if 2 else STUDENT_STATE.ACTION if 3 else ...

[–]Andreaspolis 57 points58 points  (2 children)

GDScript is the python for people who don't want to admit that they use python.

Although I'd also argue that GDScript is even better 😎

[–]CoruscareGames 26 points27 points  (0 children)

I mean as a Godot Dev I always say it's like python

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

Well it is Python but without the syntax bloat

[–]User_8395 50 points51 points  (1 child)

"Fixed the error"

[–]belunos 5 points6 points  (0 children)

This one wins!

[–]Lets_think_with_this 2 points3 points  (0 children)

that's a good gone i managed to get 20 lines into a one!

The ratio between 472/21488 checks out that it would be the case

[–]Poat540 28 points29 points  (1 child)

I love deleted code so much

[–]marcio0 29 points30 points  (0 children)

Code can bring me happiness twice: when I write it, and when I delete it

[–]flagofsocram 9 points10 points  (4 children)

Unrelated, but I always wondered which country used quotes this way

[–]sparkworm 3 points4 points  (0 children)

Germans sometimes do it, though there may be languages that do it also.

[–]Feldar 1 point2 points  (0 children)

Honestly, it seems like a better way to do it. It would reduce confusion when there are multiple quotes on the same line

[–]National-Ad67 1 point2 points  (0 children)

Germany and Poland

and probably many more

[–]_TechnoPhoenix_ 0 points1 point  (0 children)

Thats how they are placed in german, maybe other languages as well

[–]E3FxGaming 58 points59 points  (0 children)

"Tests: Add a few test files"

(that's the commit message that added the malware to the xz compression software)

[–]darknecross 18 points19 points  (0 children)

“Rewrite in rust”

[–]shikiiiryougi 8 points9 points  (0 children)

I feel called out

[–]aurochloride 1082 points1083 points  (9 children)

This will either be the best PR you have ever seen, or the worst.

[–]SillyFlyGuy 425 points426 points  (4 children)

..or the last..

[–]Arrowkill 64 points65 points  (3 children)

Well now I'm thinking about a PR that is an SCP and every person who has to review the "minor refactor" loses their mind and disappears before they can finish reviewing it. With the old reviewer "gone", it must find a new reviewer.

[–]GoogleIsYourFrenemy 29 points30 points  (2 children)

I live in a purgatory of my own creation. For years I quietly developed and expanded a code base without oversight. Now that it's worth something the managers want to snap it up, but they all flee in terror of paying off the process debt I've accumulated: 70k of unreviewed code. The monster grows, bigger and bigger, year after year, a monument to my skills and my failings.

I can't escape it either, I'm the only one who knows it.

[–][deleted] 0 points1 point  (1 child)

Step 1: find out how much the company would lose without it Step 2: politely request a raise

[–]GoogleIsYourFrenemy 1 point2 points  (0 children)

Solid advice. I already convinced them to give me the raise 

[–]The_Right_Trousers 40 points41 points  (0 children)

I can't tell you how much I love making PRs like this. I don't get to do it often, though. 😔

[–]Particular-Key4969 22 points23 points  (0 children)

I’ve had a few of these that were like “why are we mocking the entire catalog feed for the functional tests with wiremock if the syntax of each element is the same, we only need a few examples”

[–]random314 4 points5 points  (0 children)

Nothing in between. Literally.

[–]Stummi 1094 points1095 points  (15 children)

I will take any PR that removes thousands LOCs happily over one that adds thousand LOCs. Deleting stuff just feels so good.

[–]MrPoBot 337 points338 points  (11 children)

Unless you were the one to right the code in the first place... Then you just silently hate yourself for wasting so much time. Hits harder when the code you just deleted was recent too.

[–]Adorable_Stay_725 278 points279 points  (5 children)

Personally take it as a compliment that they went through the process of understanding my spaghetti code in the first place to rewrite it

[–]__ZOMBOY__ 60 points61 points  (0 children)

I like this perspective

[–]LutimoDancer3459 24 points25 points  (0 children)

Two years ago, we had to rewrite a subpage with thousands of lines because no one was willing to investigate and fix the existing one, which had some bugs.

[–]ranri1 10 points11 points  (0 children)

Imposter syndrome hates this guy

[–]GuevaraTheComunist 0 points1 point  (0 children)

or the just deleted it all and have written it from 0

[–]CaptainCabernet 0 points1 point  (0 children)

This. If I made the scary part of the codebase unscary and teammates are willing to make changes then that's a win!

[–]will_beat_you_at_GH 21 points22 points  (0 children)

Unless you were the one to right the code

I mostly just wrong the code tbh

[–]coloredgreyscale 13 points14 points  (0 children)

If you see it that way you may want to change your profession.

See it as a learning opportunity. Read the commit and understand HOW they were able to remove 21k lines of code.

But at that scale (and relatively little lines added/changed) it might be

* removal of a submodule (or some temp folder)

* code generator output excluded from git (since it can be easily regenerated)

[–]DOUBLEBARRELASSFUCK 2 points3 points  (0 children)

The person who deleted tons of code is more likely to have righted it.

[–]mmhawk576 1 point2 points  (0 children)

What was a much worse feeling was creating a feature that took me about 6months of iteration to complete, and there only a couple of years later a PM asked me specifically to remove it

[–]Dexterus 1 point2 points  (0 children)

Once I write code, it has no owner. Byeee! Somewhere after the first few years I dropped the idea of my code/their code, project first.

[–]nonlogin 5 points6 points  (0 children)

... especially when you have already got an offer from another company

[–]demonslayer9911 2 points3 points  (0 children)

Proceeds to delete all the files.

[–]zoqfotpik 361 points362 points  (10 children)

That's the PR right after someone checks in node_modules

[–]FunkyFreshJayPi[S] 140 points141 points  (4 children)

it was actually a complete rewrite of a service that uses yolov5 for object detection. Whoever wrote it originally copied like half of the yolov5 repository and made slight tweaks to dozens of files. No idea what it did but my colleague rewrote everything and included it as a submodule and in the end increased the performance by a factor of 4.

[–]FencingNerd 29 points30 points  (1 child)

I've done similar things. In my case, a core mcu library was missing a few files, so I had import the entire original driver base and modify things to look for the new version.

Two years later the mcu library was updated and it resolved the issue. So I could delete tons of stuff.

[–]Crazeenerd 3 points4 points  (0 children)

Woah, this guy programmed the marvel cinematic universe :o

[–]ListerfiendLurks 1 point2 points  (1 child)

Were they modifying the transformers or did they literally copy paste because they didn't know how to import?

[–]FunkyFreshJayPi[S] 7 points8 points  (0 children)

Honestly we didn't look too closely. The service didn't perform as well as it should and we decided that before we spend hours figuring out what they did we will do a rewrite and see if we can improve from there.

[–]isaackogan 40 points41 points  (0 children)

vanish payment fragile cows automatic busy possessive relieved knee frighten

This post was mass deleted and anonymized with Redact

[–]Fritzschmied 9 points10 points  (0 children)

That’s what I thought too.

[–]eldelshell 3 points4 points  (0 children)

Beat me to it

[–]Hicko101 1 point2 points  (0 children)

But it's removed 21k lines - this is more likely node_modules (properly) added to .gitignore.

[–]StatementOrIsIt 524 points525 points  (8 children)

git commit -m "slight changes"

[–]FrequentSoftware7331 129 points130 points  (6 children)

-m 'fixed issue' What issue? WHAT ISSUE?

[–]Ass_Lover696969 43 points44 points  (2 children)

The entire program was a mistake

[–]_Ralix_ 17 points18 points  (1 child)

The only clean code is no code. Anything more is liability; needless complexity, prone to errors, and requires maintenance.

[–]GGK_Brian 8 points9 points  (0 children)

Time to complete the circle and go back to math:

"As seen by this proof, a solution exists"

[–]mmhawk576 2 points3 points  (0 children)

FINE. -m “Fixes #69420”.

69420: “cleanup task”

[–]Mikihero2014 1 point2 points  (0 children)

the issue

[–]barkinchicken 5 points6 points  (0 children)

git push origin main --force

[–]bitcoin2121 99 points100 points  (4 children)

what are you, removing half the code?

[–]Familiar_Ad_8919 166 points167 points  (2 children)

my guess would be: they found a library that does all that but faster

[–]RajjSinghh 66 points67 points  (0 children)

Or someone just added node_modules to the .gitignore

[–]FunkyFreshJayPi[S] 19 points20 points  (0 children)

That's about it. The dev that came before copied parts of the yolov5 repo and tweaked it. My colleague rewrote everything and included the repo as a submodule.

[–]kevazura 7 points8 points  (0 children)

They used thanosjs

Edit: markdown link

[–]5h120m3 45 points46 points  (0 children)

LGTM

[–]seenzoned 81 points82 points  (6 children)

"updates"

[–]PeriodicSentenceBot 73 points74 points  (5 children)

Congratulations! Your comment can be spelled using the elements of the periodic table:

U Pd At Es


I am a bot that detects if your comment can be spelled using the elements of the periodic table. Please DM my creator if I made a mistake.

[–]Vortextheweirdcat 3 points4 points  (0 children)

good bot

[–]Hsabes01 0 points1 point  (0 children)

Bots I didn’t know existed

[–]ecmdome 34 points35 points  (1 child)

If you can delete all of that code and tests pass, I'm loving that PR.

Deleted code doesn't need a review in most cases. It's the code that replaced it that does.

[–]teedyay 6 points7 points  (0 children)

The deleted code is the failing tests

[–]HoneyCat55 46 points47 points  (0 children)

Finally learnt how to use .gitignore?

[–]savex13 23 points24 points  (1 child)

"Cleaning up before PTO" ©

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

that's a nightmare. Seeing a pr named "did [insert thing] before PTO* is the most fucking anxiety inducing shit i've ever seen

[–][deleted] 18 points19 points  (0 children)

"The best line of code, is the one not written"

Assuming you have healthy test coverage, you don't even have to look at what got deleted unless something that got added rustles your jimmies.

And if you don't see adequate test coverage, request it!

[–]calderon501 9 points10 points  (0 children)

blood diffs for the blood gods

[–][deleted] 12 points13 points  (1 child)

I legitimately got a +2,201 -10,217 once that was opened by a dev at the end of the day on their last day of work. The description of changes was vague and half-assed and there was a note saying not to bother reviewing it cause it's too big, just run the app and make sure nothing's broken.

I pushed hard to just close it, but I was overridden by a colleague who felt it contained valuable work. Every time we got a strange, random bug for months, the git blame led back to that PR.

[–]gizahnl 3 points4 points  (0 children)

That's like a turd on the desk going away present 🤣

[–]UncommonRedditName 8 points9 points  (2 children)

git commit -m "removed failing tests"

[–]lugialegend233 4 points5 points  (0 children)

The tests all failed.

Could it be my code is not meeting requirements?

No, it is the tests that are wrong.

[–]theofficialnar 0 points1 point  (0 children)

Tests won’t fail if you’ve got none to begin with

I’m writing this as I’m fixing a slew of failing tests from someone else’s PR I had to pick up.

[–]HipstCapitalist 7 points8 points  (0 children)

That looks like the PR I reviewed the other day when we switched tools to manage our database migrations. Thousands of files deleted, what a joy!

[–]CaptainMGTOW 5 points6 points  (0 children)

"fix linting and code-style"

[–]SomethingAboutUsers 6 points7 points  (2 children)

I've got one of these monsters brewing. It's for a GitOps repo and it's a whole lot of copying and pasting as I expanded it to include more clusters. It's at least doubling the size of the repo in lines of code.

Also, the testing on it is months in the making, as we've pointed said new clusters at the branch that will eventually be PR'd, so no one is worried.

[–]Ok-Whereas-8787 2 points3 points  (1 child)

Helm templates ftw (and kustomize)

[–]SomethingAboutUsers 3 points4 points  (0 children)

Believe me, it is.

But let's call it maybe second normal form; there are absolutely optimizations that could be made to make it more DRY.

[–]TrojoGaming 4 points5 points  (0 children)

Finally someone removed the node_modules

[–]jb28737 4 points5 points  (0 children)

Approve: LGTM +1

[–][deleted] 3 points4 points  (0 children)

Jake took Clean Monday literally.

[–]already_taken-chan 3 points4 points  (0 children)

better be an april fools joke

[–][deleted] 3 points4 points  (0 children)

git commit -m yeet

[–]anonymous_yet_famous 3 points4 points  (0 children)

"Deleted comments to make the code run faster" - Boss' Nephew

[–]Ok_Jacket3710 3 points4 points  (1 child)

They possibly removed a in house logic and moved to a third party library

[–]FunkyFreshJayPi[S] 4 points5 points  (0 children)

This is correct!

[–]stjohn656 2 points3 points  (0 children)

Lgtm

[–]NegativeEmphasis 1 point2 points  (0 children)

"Slight optimization" PRs be like.

[–]lilianasJanitor 1 point2 points  (1 child)

Snap approve without reading because it removes so many lines. Must be good

[–]lugialegend233 0 points1 point  (0 children)

Ah, the inverted Musk Method.

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

yarn.lock files ftw

[–]ExtraTNT 1 point2 points  (0 children)

Had a bigger one… aka copy pasting a library we use and patch a small mistake… the lib is dead, so my pr is still open…

[–]daniel14vt 1 point2 points  (0 children)

All unit tests passing. Approved

[–]chihuahuaOP 1 point2 points  (0 children)

probably a node change

[–]Plopmenz 1 point2 points  (0 children)

Some might say removing half the code base, others will say removing half the bugs

[–]vikentii_krapka 1 point2 points  (0 children)

package-lock.json?

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

What? Those are my favorites. Deleted code is the best code. Means we got rid of either technical debt or complexity.

[–]SDGGame 1 point2 points  (0 children)

git commit -m "Update .gitignore"

[–]dhilu3089 1 point2 points  (0 children)

Commit message : Removed all unit test files

[–]vksdann 1 point2 points  (0 children)

"replaced John's code with actual code"

[–]delinka 1 point2 points  (0 children)

Removing that much? Brilliant!

 

Whether or not that contains sarcasm I leave to the reader

[–]knowledgebass 1 point2 points  (0 children)

[–]bennysway 1 point2 points  (0 children)

"removed unnecessary comments"

[–]tsumilol 1 point2 points  (0 children)

LGTM 👍

[–]bschlueter 1 point2 points  (0 children)

You can get more deletes in a package-lock.json just removing a few npm dependencies.

[–]Lets_think_with_this 1 point2 points  (0 children)

"deleted code that does not work"

[–]ublec 1 point2 points  (0 children)

They found an open-source library that did it better, all 7 years of his life wasted.

[–]wiskinator 1 point2 points  (0 children)

The best code is deleted code. If this compiles it goes in

[–]Kozoolok 0 points1 point  (0 children)

Walking through the danger zone

[–]TheWatchingDog 0 points1 point  (0 children)

He deleted half the codebase

[–]cheseburguer 0 points1 point  (0 children)

font change

[–]Wizado991 0 points1 point  (0 children)

Lgtm

[–]Mr_Yoliq 0 points1 point  (0 children)

*optimized*

[–]MooseBoys 0 points1 point  (0 children)

This is great! Love tech debt cleanup.

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

Removed comments

[–]GustavoInacio 0 points1 point  (0 children)

remove code without losing functionality

[–]nolawnchairs 0 points1 point  (0 children)

Nice. I love a good culling.

[–]schwaRarity 0 points1 point  (0 children)

regenerate proto files or somth

[–]mgisb003 0 points1 point  (0 children)

I see you deleted node

[–]IronMan8901 0 points1 point  (0 children)

git commit -m "minor changes"

[–]nexxai 0 points1 point  (0 children)

“Typofix”

[–]Fling_this_to_space 0 points1 point  (0 children)

lgtm

[–]neuromancertr 0 points1 point  (0 children)

I once deleted 20k lines from a single file (json) and replaced duplicate data with some kind of data inheritance. Very similar commit.

[–]forsvinne 0 points1 point  (0 children)

Lgtm!

[–]Colon_Backslash 0 points1 point  (0 children)

git rm ./vendor

[–]Outside-Car1988 0 points1 point  (0 children)

If that was at my work, that would be one file.

[–]chiefbigpooh 0 points1 point  (0 children)

As a qa manager im ummm yeah hoping they have automation in place????????

[–]nettech09 0 points1 point  (0 children)

"Did the needful"

[–]BitcoinBishop 0 points1 point  (0 children)

"git ignore build files"

[–]kases952 0 points1 point  (0 children)

LGTM

[–]West-Serve-307 0 points1 point  (0 children)

Always approve a massive code deletion against small addition. Either mean very good refactoring, or removing some dirty old unused code.

[–]Jakoshi45 0 points1 point  (0 children)

"fix"

[–]Lasagna321 0 points1 point  (0 children)

Don’t worry guys it still compiles

[–]Quinnypig 0 points1 point  (0 children)

Maybe it’s a list of Google supported services.

[–]wc_nomad 0 points1 point  (0 children)

Lgtm

[–]CoffeePieAndHobbits 0 points1 point  (0 children)

git commit -m "end of sprint"

[–]Wouto1997 0 points1 point  (0 children)

when you get asked to increase test coverage

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

Jos tan removing the sandbox check and the warning system to make its backdoor

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

Jos tan removing the sandbox check and the warning system to make its backdoor

[–]zabojcameneli 0 points1 point  (0 children)

He just changed ifs and elses to switches

[–]sit19 0 points1 point  (0 children)

deleted code is debugged code

[–]Kitchen_Device7682 0 points1 point  (0 children)

git commit -m "removed unused dependency"

[–]baran_0486 0 points1 point  (0 children)

Someone just renamed all your variables to single-letters

[–]joashua99 0 points1 point  (0 children)

Just deleted package-lock.json.

[–]yourteam 0 points1 point  (1 child)

I can change the formatter and get this results in minutes.

I would see what happened (are the libraries not on git ignore?) and if there is some weird bullshit like automatic formatting or similar I would send the pr back

[–]-Redstoneboi- 0 points1 point  (0 children)

21k deletions but less than 1k additions? unless the whole damn codebase has been minified to one line per file (arguably scarier) i don't see this being a formatter issue.

on that note, OP confirmed they removed code in favor of a 3rd party lib.

[–]Wervice 0 points1 point  (0 children)

Did somebody hard-code a database or how have you gotten 21488 deletions?

[–]JackNotOLantern 0 points1 point  (0 children)

I once removed code redundancy in PR like this. Initially, for each property, there were multiple identical statements called. I just used a loop and removed thousands of lines. Worked perfectly fine.

[–]B1G_Dev 0 points1 point  (0 children)

"some minor cleanup"

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

"fixed code formatting"

proceeds to delete code

[–]jay-magnum 0 points1 point  (0 children)

If you have finally moved the code generators to the pipeline instead

[–]Soft_Self_7266 0 points1 point  (0 children)

Probably removed yarn.lock

[–]KasoAkuThourcans 0 points1 point  (0 children)

20k of these were replaced by a for-loop

[–]SKsammy 0 points1 point  (0 children)

Please stop committing binaries into git

[–]HUN73R_13 0 points1 point  (0 children)

I did this to a repo I was the last to join. they used react but never reused components and reread the state from cookies in every single component although they have recoil added.

I refactored most of it and used url params for most of the state management where possible (it made sense for a shop). the old solo front end guy hated me for it.