==Terminology==
Some programming languages, such as [[COBOL]] and [[BASIC]], make a distinction between functions that return a value (typically called "functions") and those that do not (typically called "subprogram", "subroutine", or "procedure"). Other programming languages, such as [[C]], [[C++]], and [[Rust (programming language)|Rust]], only use the term "function" irrespective of whether they return a value or not. Some object-oriented languages, such as [[Java]] and [[C Sharp (programming language)|C#]], refer to functions inside classes as "methods".
The meaning of each callable term (function, procedure, method, ...) is, in fact, different. They are not [[synonymous]]. Nevertheless, they each add a capability to programming that has commonality.
The term used tends to reflect the context in which it is used {{endash}} usually based on the language being used. For example:
* ''Subprogram'', ''routine'' and ''subroutine'' were more commonly used in the past but are less common today
* ''Routine'' and ''subroutine'' have essentially the same meaning but describe a hierarchical relationship, much like how a subdirectory is structurally subordinate to its parent [[Directory (computing)|directory]]; ''program'' and ''subprogram'' are similarly related
* Some consider ''function'' to imply a [[Function (mathematics)|mathematical function]], having no side-effects, but in many contexts ''function'' refers to any callable
* In the context of [[Visual Basic]] and [[Ada (programming language)|Ada]], {{code|Sub}}, short for ''subroutine'' or ''subprocedure'', is the name of a callable that does not return a value whereas a {{code|Function}} does return a value
* [[Object-oriented programming|Object-oriented]] languages such as [[C Sharp (programming language)|C#]] and [[Java (programming language)|Java]] use the term ''[[method (computer programming)|method]]'' to refer to a member function of an [[Object (computer science)|object]]
==History==
|