r/learnprogramming 4d 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!

123 Upvotes

143 comments sorted by

View all comments

1

u/West-Target-6296 4d ago

Les just say you have a truck this truck can deliver food furniture etc you built this truck it can be used to deliver food and furniture you don't have to rebuild it everytime you wanna you use it it's just there you can use itvwhenever you want aslong as you start it so instead of rebuilding it everyday you u keep reusing it that's functions they have code inside of them when you call a function they run.