r/programminghorror • u/maselkowski • Mar 19 '26
Trimba bimba dubba dimba
I've found yet again some atrocities in code, that is some one of function nested in method: trimba. So I took the hit and split it into partial nested functions. I didn't even know you could do this in PHP.
430
Upvotes
50
u/Loud_Investigator_26 Mar 19 '26
dude wtf is this
26
u/v_maria Mar 19 '26
defining a function inside a function is not bad on it's own, but i also didnt know you could do that in php
178
u/Splatpope Mar 19 '26
web devs will go to absurd lengths to avoid making regexes that weren't copy pasted from a w3schools tutorial
11
u/NoOven2609 Mar 19 '26
The original author was just memeing, none of those functions serve a purpose, it could just be 4 replace statements in the top level function
10
u/GoddammitDontShootMe [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo "You live" Mar 19 '26
The fuck is with those function names?
8
u/TheBrainStone Mar 19 '26
Nothing beats the horror of intentionally bad code
8
u/Beretha Mar 19 '26
The nested functions remove characters that would have been removed anyways by the regex replacement. Absolute cinema.
5
u/Lafuene Mar 19 '26
Bimbofication is my fav abomination
4
u/CYG4N Mar 19 '26
Osoba? is this polish code?
3
u/Infinite_Self_5782 Mar 19 '26
babababababababababababa trimman!
2
u/robin_888 Mar 20 '26
Is line 112 already your refactoring or was that there all along..?
1
u/lnkarma Mar 20 '26
I’m sad to see nobody from West Bengal
1
u/prehensilemullet Mar 21 '26
I guess that’s one way to flex that you have too much time on your hands, jeez
1
u/Jason5Lee Mar 23 '26
The programmer must have watched Boohbah alot.
1
u/Kapshan Mar 24 '26
Is this the A-Bank codebase?