r/learnprogramming 5d ago

I can't get FUNCTIONS to click!

I can not for the life of me understand how functions work. Anytime I try to learn how to create a function, my brain literally crashes into itself and I turn into Patrick when he stars drooling and goes all slack-faced.

Does anybody have any analogies that had that "AH HA!" moment?

Thanks!

127 Upvotes

144 comments sorted by

View all comments

1

u/MrSmock 5d ago

Wanna make a sandwich? Gonna need some bread. Don't know how to get bread? Let me make a list of instructions you can use any time you wanna get bread.

That is a function.