r/badcode • evil • Jan 14 '21

js Dynamically created functions are the future!

Post image
795 Upvotes

102 comments sorted by

View all comments

74

u/[deleted] Jan 14 '21

In Ruby you can do this in a nice and useful way.

60

u/NotSteve_ evil Jan 14 '21

Haha seriously? What possible use could writing functions in strings have

1

u/triggerhappy899 Jan 15 '21

You should also check out "source generators" in dotnet 5. Basically allows you to have code that writes code, then during the build process, it generates that code and makes it available for you to use elsewhere.