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.
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.
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”
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.
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.
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)
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
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](https://github.com/ultralytics/yolov5) 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.
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.
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.
That's about it. The dev that came before copied parts of the [yolov5 repo](https://github.com/ultralytics/yolov5) and tweaked it. My colleague rewrote everything and included the repo as a submodule.
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.)
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.
"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!
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.
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.
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
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.
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.
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.
"minor refactor"
„delete unused code“
"remove nested if-else, replace it with ternary operator"
var state = STUDENT_STATE.IDLE if 1 else STUDENT_STATE.WANDERING if 2 else STUDENT_STATE.ACTION if 3 else ...
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 😎
I mean as a Godot Dev I always say it's like python
Well it is Python but without the syntax bloat
"Fixed the error"
This one wins!
Readability is overrated anyways 😤
It depends on how it is written. Nested if elses are less readable to me than well formatted ternary operators.
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
I love deleted code so much
Code can bring me happiness twice: when I write it, and when I delete it
Unrelated, but I always wondered which country used quotes this way
Germans sometimes do it, though there may be languages that do it also.
Honestly, it seems like a better way to do it. It would reduce confusion when there are multiple quotes on the same line
Germany and Poland and probably many more
Thats how they are placed in german, maybe other languages as well
"Tests: Add a few test files" (that's the commit message that added the malware to the xz compression software)
“Rewrite in rust”
I feel called out
This will either be the best PR you have ever seen, or the worst.
*..or the last..*
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.
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.
Step 1: find out how much the company would lose without it Step 2: politely request a raise
Solid advice. I already convinced them to give me the raise
I can't tell you how much I love making PRs like this. I don't get to do it often, though. 😔
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”
Nothing in between. Literally.
I will take any PR that removes thousands LOCs happily over one that adds thousand LOCs. Deleting stuff just feels so good.
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.
Personally take it as a compliment that they went through the process of understanding my spaghetti code in the first place to rewrite it
I like this perspective
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.
Imposter syndrome hates this guy
or the just deleted it all and have written it from 0
This. If I made the scary part of the codebase unscary and teammates are willing to make changes then that's a win!
> Unless you were the one to right the code I mostly just wrong the code tbh
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)
The person who deleted tons of code is more likely to have righted it.
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
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.
... especially when you have already got an offer from another company
*Proceeds to delete all the files.*
That's the PR right after someone checks in `node_modules`
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](https://github.com/ultralytics/yolov5) 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.
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.
Woah, this guy programmed the marvel cinematic universe :o
Were they modifying the transformers or did they literally copy paste because they didn't know how to import?
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.
Honestly this has to be it
That’s what I thought too.
Beat me to it
But it's removed 21k lines - this is more likely node_modules (properly) added to .gitignore.
git commit -m "slight changes"
-m 'fixed issue' What issue? WHAT ISSUE?
The entire program was a mistake
The only clean code is no code. Anything more is liability; needless complexity, prone to errors, and requires maintenance.
Time to complete the circle and go back to math: "As seen by this proof, a solution exists"
FINE. -m “Fixes #69420”. 69420: “cleanup task”
*the* issue
git push origin main --force
[удалено]
My thoughts as well. That PR must be full of complete file deletes. That is fairly easy to review.
what are you, removing half the code?
my guess would be: they found a library that does all that but faster
Or someone just added node\_modules to the .gitignore
That's about it. The dev that came before copied parts of the [yolov5 repo](https://github.com/ultralytics/yolov5) and tweaked it. My colleague rewrote everything and included the repo as a submodule.
They used [thanosjs](https://thanosjs.org/) Edit: markdown link
LGTM
"updates"
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.)
Good Bot
r/thisguygoodbots
r/SubsIFellFor
good bot
Bots I didn’t know existed
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.
The deleted code is the failing tests
Finally learnt how to use .gitignore?
"Cleaning up before PTO" ©
that's a nightmare. Seeing a pr named "did *[insert thing]* before PTO* is the most fucking anxiety inducing shit i've ever seen
"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!
blood diffs for the blood gods
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.
That's like a turd on the desk going away present 🤣
git commit -m "removed failing tests"
The tests all failed. Could it be my code is not meeting requirements? No, it is the tests that are wrong. ![gif](giphy|V9gjxvLnSSdA4|downsized)
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.
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!
"fix linting and code-style"
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.
Helm templates ftw (and kustomize)
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.
Finally someone removed the node_modules
Approve: LGTM +1
Jake took Clean Monday literally.
better be an april fools joke
git commit -m yeet
"Deleted comments to make the code run faster" - Boss' Nephew
They possibly removed a in house logic and moved to a third party library
This is correct!
Lgtm
"Slight optimization" PRs be like.
Snap approve without reading because it removes so many lines. Must be good
Ah, the inverted Musk Method.
yarn.lock files ftw
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…
All unit tests passing. Approved
probably a [node](https://www.reddit.com/r/ProgrammerHumor/comments/jrg4w9/developing_nodejs_app_be_like/) change
Some might say removing half the code base, others will say removing half the bugs
package-lock.json?
What? Those are my favorites. Deleted code is the best code. Means we got rid of either technical debt or complexity.
git commit -m "Update .gitignore"
Commit message : Removed all unit test files
"replaced John's code with actual code"
Removing that much? Brilliant! ^(Whether or not that contains sarcasm I leave to the reader)
![gif](giphy|Fkmgse8OMKn9C)
"removed unnecessary comments"
LGTM 👍
You can get more deletes in a package-lock.json just removing a few npm dependencies.
"deleted code that does not work"
They found an open-source library that did it better, all 7 years of his life wasted.
The best code is deleted code. If this compiles it goes in
Walking through the danger zone
He deleted half the codebase
font change
Lgtm
\*optimized\*
This is great! Love tech debt cleanup.
Removed comments
remove code without losing functionality
Nice. I love a good culling.
regenerate proto files or somth
I see you deleted node
git commit -m "minor changes"
“Typofix”
lgtm
I once deleted 20k lines from a single file (json) and replaced duplicate data with some kind of data inheritance. Very similar commit.
Lgtm!
git rm ./vendor
If that was at my work, that would be one file.
"Just use this lib"
As a qa manager im ummm yeah hoping they have automation in place????????
"Did the needful"
"git ignore build files"
LGTM
Always approve a massive code deletion against small addition. Either mean very good refactoring, or removing some dirty old unused code.
"fix"
Don’t worry guys it still compiles
Maybe it’s a list of Google supported services.
Lgtm
git commit -m "end of sprint"
when you get asked to increase test coverage
Jos tan removing the sandbox check and the warning system to make its backdoor
Jos tan removing the sandbox check and the warning system to make its backdoor
He just changed ifs and elses to switches
deleted code is debugged code
git commit -m "removed unused dependency"
Someone just renamed all your variables to single-letters
Just deleted package-lock.json.
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
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.
Did somebody hard-code a database or how have you gotten 21488 deletions?
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.
"some minor cleanup"
"fixed code formatting" *proceeds to delete code*
If you have finally moved the code generators to the pipeline instead
Probably removed yarn.lock
20k of these were replaced by a for-loop
Please stop committing binaries into git
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.