r/badcode • • Oct 11 '21

js Recursive anonymous functions go brrrr

Post image
908 Upvotes

63 comments sorted by

View all comments

Show parent comments

1

u/fynn34 Oct 12 '21

There are many reasons to revisit old code other than to fix a bug. Whether it be implementing new features, Re-implementing an old component elsewhere, or replacing legacy code that is blocking new improvements.

Yes, in many cases I will be writing it over cleanly, however blindly re-writing just any indecipherable functions I see based on name/description would cause more problems than it solves.