Function (computer programming): Difference between revisions

Content deleted Content added
Meownium (talk | contribs)
m Correct link to C#, add specifier
Meownium (talk | contribs)
m Separate subprogram from routine, highlight antiquity and disuse
Line 22:
The term used tends to reflect the context in which it is used {{endash}} usually based on the language being used. For example:
 
* The terms ''routine,'' ''subroutine, or subprogram'' refer to the same meaning, but describe a hierarchical relationship, much like how a subdirectory is structurally subordinate to it's parent directory.
 
* Some consider ''function'' to imply a [[Function (mathematics)|mathematical function]], acting upon the given inputs to return an output with no side-effects, but in many contexts a ''function'' simply refers to another callable section within the program.
 
* In the context of [[Visual Basic]], {{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 -- much like [[Ada (programming language)|Ada]].
* ''Subprogram'' can be used to refer to a more generic, broad callable where multiple types of callables could exist (i.e., function and procedure), however, this term has fallen into antiquity in most spaces.
 
* [[Object-oriented programming|Object-oriented]] languages such as [[C Sharp (programming language)|C#]] and [[Java (programming language)|Java]] use the term ''method'' to refer to a member function of an [[Object (computer science)|object]], and may act on behalf of the object.