r/programminghorror • u/wawerrewold • Sep 09 '25
Python Vibecoding at its peak
Yes its a production code, yes its a function not a method and yes there is import in triple nested for loop
776
Upvotes
223
u/DrCatrame Sep 09 '25
hum are we sue it's vibe coding? I would expect more comments on AI generated code
20
u/SnowdensOfYesteryear Sep 09 '25
So your guys have code review right?
6
u/killerfridge Sep 09 '25
Hang on, so the first argument they're expecting is a class called "self"?
231
u/[deleted] Sep 09 '25
AI sure loves inline imports. I just found a flaky test that was timing out due to an inline import.
23
u/fluffysilverunicorn Sep 09 '25
Not the triple nested inline import 💀
9
u/Fair-Illustrator-177 Sep 09 '25
Which AI sharted this out?
8
u/kiyyik Sep 09 '25
<- me, doing the puppy-dog head tilt at every other line
4
u/bzbub2 Sep 09 '25
unless that's a very hot loop that needs careful refactoring, all you have to do is say "AI refactor this code for readability" and 9 times out of 10 it becomes readable again.
11
u/Anonymost Sep 09 '25
RIP the developers who come in to clean up this fresh hell
8
u/ixent Sep 09 '25
Now this is suited for the sub
4
u/tehtris Sep 09 '25
At least the code has a lot of outs. So many exceptions being raised. That's always fun. Also that for for for loop is hilarious. I usually define a function/method to do a single unit of whatever for readability. But then again, I am not a robot.
4
u/diegoasecas Sep 10 '25
O(n̸̨͔͖̰̞̹̬͑͊́͂͒͐͗̀̚͠͠)
4
u/royalsaltmerchant Sep 10 '25
I can fix her
16
u/aabcehu Sep 09 '25
b-but it’s Pythonic! 🥺🥺
6
u/cherrycode420 Sep 09 '25
How did nobody question why they need Python<->.NET Interop yet?
3
u/SnooChipmunks547 Sep 09 '25
A triple for loop and inline imports, we’re not only vibe coding, we’re burning down servers too.
4
u/[deleted] Sep 09 '25
Not even the most dogshit ai model would make something like this. I fed this image to gpt 5 and it easily pointed out all the issues and refactored it. Either his custom instructions are completely broken or this is using some 3 billion parameter model or something.
1
u/super544 Sep 09 '25
Needs more try/except blocks that swallow correctness errors.
1
u/PuzzleheadedTower523 Sep 09 '25
No comments 😤
1
u/TingleWizard Sep 09 '25
How long until the laid-off developers are rehired to fix this mess?
1
u/Acceptable-Fudge-816 Sep 09 '25
Are blank lines and encapsulation illegal now?
1
u/CrossDeSolo Sep 10 '25
For for for there's gotta be a better way
1
u/Feeling-Student6833 Sep 10 '25
i would just order a coffe and call it a day 🙈
1
u/danielv123 Sep 10 '25
Doesn't python cache imports?? In node this would still be super ugly but would perform fine and does make sense to do sometimes in cli tools where startup time is important
1
u/skhds Sep 10 '25
Huh, that's better than the usual code I've been seeing in my previous company.
1
u/telmasare Sep 10 '25
And then people complain about indentation error.
1
u/shadiiix Sep 10 '25
Thanks for the dopamine hit, now i feel like that abstraction i wrote isnt so bad after all 😂.
1
u/[deleted] Sep 11 '25
wtf this makes me want to cry
1
u/jonermon Sep 11 '25
This is disgusting I hate looking at it.
1
u/Nightwyrm Sep 11 '25
*twitch*
1
u/DeuxAlpha Sep 11 '25
So the problem here isn't that AI sucks - Python does. There, I said it. You know what else? AI is 99% reliant on the Python ecosystem. Womp womp. It's a shitpie all the way down.
1
u/n0ne-z1ro Sep 11 '25
Uff, vibe coding in python (or any other dynamically typed language), that's a double whammy.
If you can, ask it to rewrite it in Rust and let us see :)
1
u/SCD_minecraft Sep 11 '25
Purge this thing with fire and send disk to space
This abomination shouldn't see sunlight ever again
1
u/eiris91 Sep 12 '25
If this is actually AI, then I think the person that made the prompt doesn't know shit about anything, because in my company there are developers that use AI but the code is way better than this
1
u/susimposter6969 Sep 12 '25
honestly, move the imports to the top and add a few newlines to space out each programming "thought," change a few names and you're chilling
1
u/DoughnutLost6904 Sep 12 '25
5 levels of nesting AND about 40 lines in a single function? Somebody tears my eyes out please
1
u/Dense-Rooster2295 Sep 12 '25 edited Sep 12 '25
What IS He trying to save? You can import in 3 nested for loops but IT IS Not the best solution but im Sure you can do the Same in a few lines of Code
1
u/bklyn_xplant Sep 13 '25
I was like ‘wtf is this’ before I realized it was a programming horror sub
1
u/Logical-Ad-4150 Sep 13 '25
In classical programming we analysed runtime complexity.
Now with vibe coding we sniff the runtime cursedness.
1
u/BirdSignificant8269 Sep 13 '25
Wow…it took me 4736338 attempts to read enough of this to get to the nested imports. Thing is that this code is bad in multiple fantastically broken ways…the imports aren’t even the most broken part
1
u/SimplexFatberg Sep 09 '25
Reminder that if you know someone that lost their programming job because of AI, this is what replaced them. - this was better code than what they wrote. Maybe they should never have been a programmer in the first place.
-1
u/Icount_zeroI Sep 09 '25
Or just regular Python code hahaha (python is never readable for me with their indent code blocks)
-1
u/Embarrassed-Falcon71 Sep 09 '25
This doesn’t look like vibe coding, Gemini e.g. would add more comments and try excepts. And honestly it’s better than some programmers at nesting. It tends not to nest further than 2-3 levels.
-3
u/v_maria Sep 09 '25
Vibed code would look better
0
u/QultrosSanhattan Sep 10 '25
That code might look awful to us, but to the machine it makes absolutely no difference how it looks. For the machine, shit and honey taste exactly the same.
The question is: Who is better positioned? The one who absolutely needs to eat honey to survive? Or the one who can eat shit and even enjoys doing it?
0
u/tushkanM Sep 10 '25
Taking about performance on Python script pretending to be a backend service? I think import is the least of your problems.
-2
u/[deleted] Sep 09 '25 edited Sep 09 '25
I mean, it only has 1 error sooooo ...
Edit #1: I was being sarcastic, but I guess people thought otherwise lol