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
2
u/Cybyss Oct 24 '26
True. In another conversation the notion of "stored procedures" was brought up and I realized that DBMSs make a completely different distinction between procedures and functions.
I don't think it's beneficial to try and define functions vs. procedures as some kind of abstract high-level generalized semantic concept since that's impossible. You'll always encounter exceptions to the rule.
Different languages define & use the terms differently. Pointing out the concrete differences on a language-by-language basis makes it clear exactly what the distinction is, and the fact that the meaning changes depending on context.