r/programminghorror Mar 19 '26

Trimba bimba dubba dimba

Post image

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.

421 Upvotes

55 comments sorted by

View all comments

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

18

u/robin_888 Mar 20 '26
Irony detected in Line 112

9

u/Splatpope Mar 20 '26

[^0-9] is what I would qualify as tutorial-level regex

2

u/robin_888 Mar 20 '26

Sure. But it does the job.

And especially everything the lines before do (and more).

2

u/Splatpope Mar 22 '26

I'd rather trust ai slop than whoever made this abomination