Direct style

From Wiki @ Karl Jones dot com
Revision as of 12:47, 29 November 2016 by Karl Jones (Talk | contribs) (Created page with "In computer programming, '''direct style''' is the usual style of sequential programming, in which control is passed implicitly by simply going to the nex...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

In computer programming, direct style is the usual style of sequential programming, in which control is passed implicitly by simply going to the next line, by subroutine calls, or by constructs such as return, yield, or await.

Continuation-passing style

Direct style is contrasted with continuation-passing style, in which control is passed explicitly in the form of a continuation. Direct style programming is widely viewed as easier to write and understand than continuation-passing style, and thus a number of programming language constructs exist to eliminate or minimize the need to explicitly use continuations.

In mainstream languages continuation-passing style primarily occurs by passing closures as callbacks (function arguments), and thus direct style more simply means that functions return a value, rather than taking a function argument.

See also

External links