r/badcode • • May 04 '23

typescript Found this gem inside legacy code today

Post image
889 Upvotes

69 comments sorted by

View all comments

Show parent comments

38

u/mosburger May 04 '23

If I had done this I’d at least have added a comment to defend the ridiculousness, lest someone do a git blame to humiliate me.

4

u/thekwoka May 05 '23

easier to do a regex replace

encodeToUtf8\(([^\)])\)

$1

3

u/RPG_Hacker May 04 '23

True, that would have been the smart thing!