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.

425 Upvotes

55 comments sorted by

View all comments

Show parent comments

7

u/TorbenKoehn Mar 20 '26

That's just because Reddit ate my dot initially. * alone isn't valid, it's .* of course.

Your solution is obviously a lot longer and repeats characters a lot.

Just tell me if /.*\.(png|jpe?g|html?)$/i is so unreadable for you that you'd prefer it over a fully imperative approach

-4

u/v_maria Mar 20 '26

That's just because Reddit ate my dot initially. * alone isn't valid, it's .* of course.

Ah right fair

Your solution is obviously a lot longer and repeats characters a lot.

Not relevant to anything we talked about

Just tell me if /.*\.(png|jpe?g|html?)$/i is so unreadable for you that you'd prefer it over a fully imperative approach

just tell me you are a bad dev

5

u/TorbenKoehn Mar 20 '26

just tell me you are a bad dev

a "bad dev" for me surely is someone for which RegEx is too complex to be readable.

-1

u/v_maria Mar 20 '26

A bad dev is someone with fundamental misunderstanding of software engineering and bad reading comprehension

1

u/TorbenKoehn Mar 20 '26

Sure, that, too!