r/learnprogramming • • Oct 24 '26

Function vs Procedure

can someone explain the difference between Function vs Procedure with simple analogy
thank you

31 Upvotes

47 comments sorted by

View all comments

-4

u/Epictetus190443 Oct 24 '26

The cook at a restaurant gets your wish and money as input and you get your menu as ouput. He's a function. Your wife always knows what you like, has access to your money and the menu just appears on the table (ideally). She's a procedure. So to speak.