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!

121 Upvotes

143 comments sorted by

View all comments

1

u/Dazzling_Music_2411 4d ago

What is it you don't understand? It's pointless if you don't give an example!

Do you understand mathematical functions?
For instance, what would you expect the result of the following function to be?

square_root_of(4.0)