Function (computer programming) in the context of Procedural programming language


Function (computer programming) in the context of Procedural programming language

Function (computer programming) Study page number 1 of 1

Play TriviaQuestions Online!

or

Skip to study material about Function (computer programming) in the context of "Procedural programming language"


⭐ Core Definition: Function (computer programming)

In computer programming, a function (also procedure, method, subroutine, routine, or subprogram) is a callable unit of software logic that has a well-formed interface and behavior and can be invoked multiple times.

Callable units provide a powerful programming tool. The primary purpose is to allow for the decomposition of a large and/or complicated problem into chunks that have relatively low cognitive load and to assign the chunks meaningful names (unless they are anonymous). Judicious application can reduce the cost of developing and maintaining software, while increasing its quality and reliability.

↓ Menu
HINT:

👉 Function (computer programming) in the context of Procedural programming language

Procedural programming is a programming paradigm, classified as imperative programming, that involves implementing the behavior of a computer program as procedures (a.k.a. functions, subroutines) that call each other. The resulting program is a series of steps that forms a hierarchy of calls to its constituent procedures.

The first major procedural programming languages appeared c. 1957–1964, including Fortran, ALGOL, COBOL, PL/I and BASIC. Pascal and C were published c. 1970–1972.

↓ Explore More Topics
In this Dossier

Function (computer programming) in the context of Data structure

In computer science, a data structure is a data organization and storage format that is usually chosen for efficient access to data. More precisely, a data structure is a collection of data values, the relationships among them, and the functions or operations that can be applied to the data, i.e., it is an algebraic structure about data.

View the full Wikipedia page for Data structure
↑ Return to Menu

Function (computer programming) in the context of Operator (computer programming)

In computer programming, an operator is a programming language construct that provides functionality that may not be possible to define as a user-defined function (i.e. sizeof in C) or has syntax different than a function (i.e. infix addition as in a+b). Like other programming language concepts, operator has a generally accepted, although debatable meaning among practitioners while at the same time each language gives it specific meaning in that context, and therefore the meaning varies by individual language.

Some operators are represented with symbols – characters typically not allowed for a function identifier – to allow for presentation that is more familiar looking than typical function syntax. For example, a function that tests for greater-than could be named gt, but many languages provide an infix symbolic operator so that code looks more familiar. For example, this:

View the full Wikipedia page for Operator (computer programming)
↑ Return to Menu

Function (computer programming) in the context of Abstraction (computer science)

In software, an abstraction provides access while hiding details that otherwise might make access more challenging. It focuses attention on details of greater importance. Examples include the abstract data type which separates use from the representation of data and functions that form a call tree that is more general at the base and more specific towards the leaves.

View the full Wikipedia page for Abstraction (computer science)
↑ Return to Menu

Function (computer programming) in the context of Snippet (programming)

In computer programming, a snippet is a relatively small amount of source code that is stored and later inserted into a larger codebase as part of the process of writing the code. Some development tools such as a code editor or an integrated development environment (IDE) provide snippet management features to enhance productivity by allowing a developer to insert a fragment of code instead of typing it.

In contrast to an abstraction construct, such as a function, a snippet is a form of copy and paste programming – a macro operation that expands the stored template text and inserts the result into the source code. Snippet insertion is similar to a preprocessor macro except that it's like inserting the expansion of the macro definition rather than referencing it. Changing the snippet after insertion does not affect the code as does changing the definition of a preprocessor macro. For this reason, best practice is to use a snippet only for relatively simple code such as a function prototype, control structure, or library import. A snippet is typically used when an abstraction is not available (i.e. not supported by the programming language) or not desirable (i.e. due to runtime overhead).

View the full Wikipedia page for Snippet (programming)
↑ Return to Menu

Function (computer programming) in the context of Object-oriented programming

Object-oriented programming (OOP) is a programming paradigm based on the object – a software entity that encapsulates data and function(s). An OOP computer program consists of objects that interact with one another. A programming language that provides OOP features is classified as an OOP language but as the set of features that contribute to OOP is contended, classifying a language as OOP and the degree to which it supports or is OOP, are debatable. As paradigms are not mutually exclusive, a language can be multi-paradigm; can be categorized as more than only OOP.

Sometimes, objects represent real-world things and processes in digital form. For example, a graphics program may have objects such as circle, square, and menu. An online shopping system might have objects such as shopping cart, customer, and product. Niklaus Wirth said, "This paradigm [OOP] closely reflects the structure of systems in the real world and is therefore well suited to model complex systems with complex behavior".

View the full Wikipedia page for Object-oriented programming
↑ Return to Menu

Function (computer programming) in the context of Control flow

In software, control flow (or flow of control) describes how execution progresses from one command to the next. In many contexts, such as machine code and an imperative programming language, control progresses sequentially (to the command located immediately after the currently executing command) except when a command transfers control to another point – in which case the command is classified as a control flow command. Depending on context, other terms are used instead of command. For example, in machine code, the typical term is instruction and in an imperative language, the typical term is statement.

Although an imperative language encodes control flow explicitly, languages of other programming paradigms are less focused on control flow. A declarative language specifies desired results without prescribing an order of operations. A functional language uses both language constructs and functions to control flow even though they are usually not called control flow statements.

View the full Wikipedia page for Control flow
↑ Return to Menu

Function (computer programming) in the context of Template (C++)

Templates are a feature of the C++ programming language that allows functions and classes to operate with generic types. This allows a function or class declaration to reference via a generic variable another different class (built-in or newly declared data type) without creating a full declaration for each of these different classes.

In plain terms, a templated class or function would be the equivalent of (before "compiling") copying and pasting the templated block of code where it is used, and then replacing the template parameter with the actual one. For this reason, classes employing templated methods place the implementation in the headers (*.h files) as no symbol could be compiled without knowing the type beforehand.

View the full Wikipedia page for Template (C++)
↑ Return to Menu

Function (computer programming) in the context of Parameter (computer programming)

In computer programming, a parameter, a.k.a. formal argument, is a variable that represents an argument, a.k.a. actual argument, a.k.a. actual parameter, to a function call. A function's signature defines its parameters. A call invocation involves evaluating each argument expression of a call and associating the result with the corresponding parameter.

View the full Wikipedia page for Parameter (computer programming)
↑ Return to Menu

Function (computer programming) in the context of Object-oriented computer programming

Object-oriented programming (OOP) is a programming paradigm based on objectssoftware entities that encapsulate data and function(s). An OOP computer program consists of objects that interact with one another. An OOP language is one that provides object-oriented programming features, but as the set of features that contribute to OOP is contested, classifying a language as OOP – and the degree to which it supports OOP – is debatable. As paradigms are not mutually exclusive, a language can be multi-paradigm (i.e. categorized as more than only OOP).

Notable languages with OOP support include Ada, ActionScript, C++, Common Lisp, C#, Dart, Eiffel, Fortran 2003, Haxe, Java, JavaScript, Kotlin, Logo, MATLAB, Objective-C, Object Pascal, Perl, PHP, Python, R, Raku, Ruby, Scala, SIMSCRIPT, Simula, Smalltalk, Swift, Vala and Visual Basic (.NET).

View the full Wikipedia page for Object-oriented computer programming
↑ Return to Menu

Function (computer programming) in the context of First-class citizen

In a given programming language design, a first-class object is an entity which supports all the operations generally available to other entities. These operations typically include being passed as an argument, returned from a function, and assigned to a variable.

View the full Wikipedia page for First-class citizen
↑ Return to Menu