Difference between revisions of "Callback (computer programming)"

From Wiki @ Karl Jones dot com
Jump to: navigation, search
(Created page with "In computer programming, a '''callback''' is a piece of executable code that is passed as an argument to other code, which is expected...")
 
 
(3 intermediate revisions by the same user not shown)
Line 7: Line 7:
 
In all cases, the intention is to specify a function or subroutine as an entity that is, depending on the language, more or less similar to a [[Variable (computer science)|variable]].
 
In all cases, the intention is to specify a function or subroutine as an entity that is, depending on the language, more or less similar to a [[Variable (computer science)|variable]].
  
Programming languages support callbacks in different ways, often implementing them with subroutines, lambda expressions, blocks, or function pointers.
+
Programming languages support callbacks in different ways, often implementing them with [[Function (programming)|subroutines]], lambda expressions, blocks, or function pointers.
  
 
== See also ==
 
== See also ==
Line 16: Line 16:
 
* [[Event loop]]
 
* [[Event loop]]
 
* [[Event-driven programming]]
 
* [[Event-driven programming]]
 +
* [[Function (programming)]] - a sequence of program instructions that perform a specific task, packaged as a unit.
 +
* [[Futures and promises]]
 
* [[Implicit invocation]]
 
* [[Implicit invocation]]
 
* [[Inversion of control]]
 
* [[Inversion of control]]
* [[libsigc++, a callback library for C++]]
 
 
* [[Parameter (computer programming)]]
 
* [[Parameter (computer programming)]]
 
* [[Signals and slots]]
 
* [[Signals and slots]]
Line 27: Line 28:
  
 
* [https://en.wikipedia.org/wiki/Callback_(computer_programming) Callback (computer programming] @ Wikipedia
 
* [https://en.wikipedia.org/wiki/Callback_(computer_programming) Callback (computer programming] @ Wikipedia
 +
* [http://callbackhell.com/ Callback Hell]
 +
* [http://www.commitstrip.com/en/2017/05/22/a-story-about-callbacks/ A Story About Callbacks] @ commitstrip.com
  
 
[[Category:Computer programming]]
 
[[Category:Computer programming]]

Latest revision as of 15:18, 13 July 2017

In computer programming, a callback is a piece of executable code that is passed as an argument to other code, which is expected to call back (execute) the argument at some convenient time.

Description

The invocation may be immediate as in a synchronous callback, or it might happen at a later time as in an asynchronous callback.

In all cases, the intention is to specify a function or subroutine as an entity that is, depending on the language, more or less similar to a variable.

Programming languages support callbacks in different ways, often implementing them with subroutines, lambda expressions, blocks, or function pointers.

See also

External links