Ask your own question, for FREE!
Computer Science 18 Online
OpenStudy (anonymous):

Difference between a routine ,method,function and an procedure????????

OpenStudy (anonymous):

routine is the way u live your life method is same as procedure and function is the job / duty given to do

OpenStudy (anonymous):

i thinks its like these, maybe am wrong, in programming, a routine its a block of code that can be called it executes on its own and then comes back where it was called, a method its a fuction or procedure of a class, a function its a routine that returns a value, a procedure its just a routine that doesnt return anything

OpenStudy (anonymous):

function and method is too similar but the difference is the term "method" used with OOP (method is a function in a class) and term "function" used in 'non-OOP' languages. procedure is a function but without anything to return (return void). the term 'routine' is used when talking about operating systems i think

OpenStudy (anonymous):

In one sense they are all the same: a block of code that is named and packaged to take arguments and possibly return a value. But there are subtle differences in usage that are mostly historical in nature. "Routine" and "subroutine" are as old as Fortran (>50 years) and tend to be used in contexts where the code is nonrecursive and where no value is returned. "Function" tends to be used when a (non-void) value is returned and also may connote that the code has no side effects (no changes to the values of its arguments or global variables and no I/O). "Procedure" tends to suggest that the code does have side effects, is called for its side effects, and if it returns a value that is secondary. These last three are in fact quite similar and no one will misunderstand you if you use them more or less interchangeably. "Method" however, is somewhat different. "Method" is used only in object-oriented languages and includes several semantic properties that "routine", "function" and "procedure" do not. One is that methods are associated with classes, and an object is of the appropriate class is always an implicit argument to a method. So when you write x.m(args) you are calling a method named "m" with arguments "args" and, implicitly, another argument x. In addition, there are issues regarding polymorphism and inheritance that come into play when the term "method is used" that don't arise with "procedure" "function" or "routine".

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!