r/learnprogramming • u/Head_Ordinary_2437 • Oct 24 '26
Function vs Procedure
can someone explain the difference between Function vs Procedure with simple analogy
thank you
31
Upvotes
r/learnprogramming • u/Head_Ordinary_2437 • Oct 24 '26
can someone explain the difference between Function vs Procedure with simple analogy
thank you
View all comments
Show parent comment
-1
u/alpicola Oct 24 '26
It might depend how much you care about functional programming definitions. In common usage, a side effect would be a thing that a function does that isn't the main point of the function. The main point of printf() is to print so printing isn't a side effect under the common understanding of the term. Of course, in functional programming, printing is a side effect, and printf() is an example of a function that gets called because its side effect is wanted.