Software Function
A Software Function is a software structure that represents a formal function.
- AKA: Program Subroutine, Function Structure.
- Context:
- It can be a member of a Software Library.
- It can range from being a Named Function to being an Anonymous Function.
- It can (typically) be a Programming Language Specific Item, such as: a Python Function, R Function, C Function, Perl Subroutine, Scala Function, ...
- It can be produced by a Function Structure Modeling Task.
- It can range, depending on the function range type, from being:
- a Value-Output Function Structure (such as a continuous-output function structure);
- a Multiset-Output Function Structure, such as a Set-Output Function Structure;
- a Sequence-Output Function Structure, such as a String-Output Function Structure;
- a Tuple-Output Function Structure, such as a Vector-Output Function.
- It can range from being a Scalar Function Structure; a Set Function Structure; Multiset Function Structure; String Function Structure; Sequence Function Structure; Tuple Function Structure; to being Vector Function Structure.
- It can range, depending on the function domain type, from being:
- a Value-Input Function Structure, such as a class-input Function Structure or a number-input function Structure;
- a Set-Input Function Structure, or a Multiset-Input Function Structure;
- a Sequence-Input Function Structure, such as a String-Input Function Structure;
- a Tuple-Input Function Structure, such as a Vector-Input Function Structure.
- It can range from being a Bijective Function Structure to being an Injective Function Structure to being a Surjective Function Structure.
- It can range from being an Associative Function Structure to being a Commutative Function Structure to being a Distributive Function Structure.
- Example(s):
- a Hash Function.
- a Library Function.
- a Statistic Function Structure.
- a Probability Function Structure.
- a Predictor Feature Function Structure.
- a software function that combines two lists by alternatingly taking elements. For example: given the two lists [a, b, c] and [1, 2, 3], the function should return [a, 1, b, 2, c, 3].
- a software function that computes the list of the first 100 Fibonacci numbers.
- a software function that given a list of non negative integers, arranges them such that they form the largest possible number. For example, given [50, 2, 1, 9], the largest formed number is 95021.
- …
- Counter-Example(s):
- a Software Class.
- a Mathematical Function.
- an Algorithm.
- an Abstract Function.
- See: Software Operation, Functional Programming, Procedural Programming, Software Class Method, Software Library.
References
2015
- (Wikipedia, 2015) ⇒ http://en.wikipedia.org/wiki/subroutine Retrieved:2015-2-13.
- In computer programming, a subroutine is a sequence of program instructions that perform a specific task, packaged as a unit. This unit can then be used in programs wherever that particular task should be performed. Subprograms may be defined within programs, or separately in libraries that can be used by multiple programs. In different programming languages, a subroutine may be called a procedure, a function, a routine, a method, or a subprogram. The generic term callable unit is sometimes used. As the name subprogram suggests, a subroutine behaves in much the same way as a computer program that is used as one step in a larger program or another subprogram. A subroutine is often coded so that it can be started (called) several times and/or from several places during one execution of the program, including from other subroutines, and then branch back (return) to the next instruction after the call once the subroutine's task is done. Maurice Wilkes, David Wheeler, and Stanley Gill are credited with the invention of this concept, which they termed a closed subroutine, contrasted with an open subroutine or macro. Subroutines are a powerful programming tool, and the syntax of many programming languages includes support for writing and using them. Judicious use of subroutines (for example, through the structured programming approach) will often substantially reduce the cost of developing and maintaining a large program, while increasing its quality and reliability. Subroutines, often collected into libraries, are an important mechanism for sharing and trading software. The discipline of object-oriented programming is based on objects and methods (which are subroutines attached to these objects or object classes).
In the compiling method called threaded code, the executable program is basically a sequence of subroutine calls.
- In computer programming, a subroutine is a sequence of program instructions that perform a specific task, packaged as a unit. This unit can then be used in programs wherever that particular task should be performed. Subprograms may be defined within programs, or separately in libraries that can be used by multiple programs. In different programming languages, a subroutine may be called a procedure, a function, a routine, a method, or a subprogram. The generic term callable unit is sometimes used. As the name subprogram suggests, a subroutine behaves in much the same way as a computer program that is used as one step in a larger program or another subprogram. A subroutine is often coded so that it can be started (called) several times and/or from several places during one execution of the program, including from other subroutines, and then branch back (return) to the next instruction after the call once the subroutine's task is done. Maurice Wilkes, David Wheeler, and Stanley Gill are credited with the invention of this concept, which they termed a closed subroutine, contrasted with an open subroutine or macro. Subroutines are a powerful programming tool, and the syntax of many programming languages includes support for writing and using them. Judicious use of subroutines (for example, through the structured programming approach) will often substantially reduce the cost of developing and maintaining a large program, while increasing its quality and reliability. Subroutines, often collected into libraries, are an important mechanism for sharing and trading software. The discipline of object-oriented programming is based on objects and methods (which are subroutines attached to these objects or object classes).
2014
- (Wikipedia, 2014) ⇒ http://en.wikipedia.org/wiki/subroutine Retrieved:2014-8-1.
- In computer programming, a subroutine is a sequence of program instructions that perform a specific task, packaged as a unit. This unit can then be used in programs wherever that particular task should be performed. Subprograms may be defined within programs, or separately in libraries that can be used by multiple programs.
In different programming languages a subroutine may be called a procedure, a function, a routine, a method, or a subprogram. The generic term callable unit is sometimes used. As the name subprogram suggests, a subroutine behaves in much the same way as a computer program that is used as one step in a larger program or another subprogram. A subroutine is often coded so that it can be started (called) several times and/or from several places during one execution of the program, including from other subroutines, and then branch back (return) to the next instruction after the call once the subroutine's task is done. Maurice Wilkes, David Wheeler, and Stanley Gill are credited with the invention of this concept, which they termed a closed subroutine, contrasted with an open subroutine or macro. Subroutines are a powerful programming tool, and the syntax of many programming languages includes support for writing and using them. Judicious use of subroutines (for example, through the structured programming approach) will often substantially reduce the cost of developing and maintaining a large program, while increasing its quality and reliability. Subroutines, often collected into libraries, are an important mechanism for sharing and trading software. The discipline of object-oriented programming is based on objects and methods (which are subroutines attached to these objects or object classes).
In the compiling method called threaded code, the executable program is basically a sequence of subroutine calls.
- In computer programming, a subroutine is a sequence of program instructions that perform a specific task, packaged as a unit. This unit can then be used in programs wherever that particular task should be performed. Subprograms may be defined within programs, or separately in libraries that can be used by multiple programs.
2009
- http://www.tutorialspoint.com/python/python_functions.htm
- QUOTE:A function is a block of organized, reusable code that is used to perform a single, related action. Functions provides better modularity for your application and a high degree of code reusing.
1996
- (Wall et al., 1996) ⇒ Larry Wall, Tom Christiansen, and Randal L. Schwartz. (1996). “Programming Perl, 2nd edition." O'Reilly. ISBN:1565921496
- QUOTE:subroutine: A named piece of program that can be invoked from elsewhere in the program in order to accomplish some sub-goal of the program. A subroutine is often parameterized to accomplish different but related things depending on its input arguments. If the subroutine returns a meaningful value, it is also called a function.