Control flow in the context of Structured programming


Control flow in the context of Structured programming

Control flow Study page number 1 of 1

Play TriviaQuestions Online!

or

Skip to study material about Control flow in the context of "Structured programming"


⭐ Core Definition: 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.

↓ Menu
HINT:

👉 Control flow in the context of Structured programming

Structured programming is a programming paradigm characterized by source code that uses block-based source code structure to encode control flow such as sequence, selection (i.e. if-then-else and switch) and iteration (i.e. for and while).

Originally, the central goal of the structured programming movement was to eliminate the need for and use of the goto statement. As goto provides powerful and flexible flow control, it can be used to write any arbitrarily complex algorithm, but the resulting code often has significant quality issues, commonly described as spaghetti code. Structured programming replaces goto with constructs that tend to result in better code. The paradigm became popular and for the most part achieved the goal of supplanting goto. In fact, its ubiquity is so thorough that for much of software development, it is simply the way code is written, no longer a topic of discussion as it once was.

↓ Explore More Topics
In this Dossier

Control flow in the context of Readability

Readability is the ease with which a reader can understand a written text. The concept exists in both natural language and programming languages though in different forms. In natural language, the readability of text depends on its content (the complexity of its vocabulary and syntax) and its presentation (such as typographic aspects that affect legibility, like font size, line height, character spacing, and line length). In programming, things such as programmer comments, choice of loop structure, and choice of names can determine the ease with which humans can read computer program code.

Higher readability in a text eases reading effort and speed for the general population of readers. For those who do not have high reading comprehension, readability is necessary for understanding and applying a given text. Techniques to simplify readability are essential to communicate a set of information to the intended audience.

View the full Wikipedia page for Readability
↑ Return to Menu

Control flow in the context of Conditional (computer programming)

In computer programming, a conditional statement directs program control flow based on the value of a condition; a Boolean expression. A conditional expression evaluates to a value without the side-effect of changing control flow.

Many programming languages (such as C) have distinct conditional statements and expressions. In pure functional programming, a conditional expression does not have side-effects, many functional programming languages with conditional expressions (such as Lisp) support side-effects.

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

Control flow in the context of Executable

In computing, an executable is a resource that a computer can use to control its behavior. As with all information in computing, it is data, but distinct from data that does not imply a flow of control. Terms such as executable code, executable file, executable program, and executable image describe forms in which the information is represented and stored. A native executable is machine code and is directly executable at the instruction level of a CPU. A script is also executable although indirectly via an interpreter. Intermediate executable code (such as bytecode) may be interpreted or converted to native code at runtime via just-in-time compilation.

View the full Wikipedia page for Executable
↑ Return to Menu

Control flow in the context of Debugging

In engineering, debugging is the process of finding the root cause, workarounds, and possible fixes for bugs.

For software, debugging tactics can involve interactive debugging, control flow analysis, log file analysis, monitoring at the application or system level, memory dumps, and profiling. Many programming languages and software development tools also offer programs to aid in debugging, known as debuggers.

View the full Wikipedia page for Debugging
↑ Return to Menu

Control flow in the context of Analytical Engine

The analytical engine was a proposed digital mechanical general-purpose computer designed by the English mathematician and computer pioneer Charles Babbage. It was first described in 1837 as the successor to Babbage's difference engine, which was a design for a simpler mechanical calculator.

The analytical engine incorporated an arithmetic logic unit, control flow in the form of conditional branching and loops, and integrated memory, making it the first design for a general-purpose computer that could be described in modern terms as Turing-complete. In other words, the structure of the analytical engine was essentially the same as that which has dominated computer design in the electronic era. The analytical engine is one of the most successful achievements of Charles Babbage.

View the full Wikipedia page for Analytical Engine
↑ Return to Menu

Control flow in the context of Code block

In computer programming, a block of source code is a grouping of statements that execute in sequential order, top to bottom. The block structure is fundamental to structured programming, where control structures are formed with blocks. Syntactically, a block acts much like a single statement in that a control structure generally operates either on a single statement or a block.

The nature of a block varies by programming language, but there are typical features. A block usually provides for visibility scope such that an identifier defined in a block is not visible in outer, containing blocks, but is visible in inner, nested blocks unless it is masked by an identifier with the same name. A block usually provides for lifetime scope such that resources associated with an identifier are partially or fully released when control flow reaches the end of the block in which the identifier was defined.

View the full Wikipedia page for Code block
↑ Return to Menu

Control flow in the context of Boolean data type

In computer science, the Boolean (sometimes shortened to Bool) is a data type that has one of two possible values (usually denoted true and false) which is intended to represent the two truth values of logic and Boolean algebra. It is named after George Boole, who first defined an algebraic system of logic in the mid-19th century. The Boolean data type is primarily associated with conditional statements, which allow different actions by changing control flow depending on whether a programmer-specified Boolean condition evaluates to true or false. It is a special case of a more general logical data type—logic does not always need to be Boolean (see probabilistic logic).

View the full Wikipedia page for Boolean data type
↑ Return to Menu

Control flow in the context of Declarative programming

In computer science, declarative programming is a programming paradigm that expresses the logic of a computation without describing its control flow.

Many languages that apply this style attempt to minimize or eliminate side effects by describing what the program must accomplish in terms of the problem domain, rather than describing how to accomplish it as a sequence of the programming language primitives (the how being left up to the language's implementation). This is in contrast with imperative programming, which implements algorithms in explicit steps.

View the full Wikipedia page for Declarative programming
↑ Return to Menu

Control flow in the context of Continuation

In computer science, a continuation is an abstract representation of the control state of a computer program. A continuation implements (reifies) the program control state, i.e. the continuation is a data structure that represents the computational process at a given point in the process's execution; the created data structure can be accessed by the programming language, instead of being hidden in the runtime environment. Continuations are useful for encoding other control mechanisms in programming languages such as exceptions, generators, coroutines, and so on.

The "current continuation" or "continuation of the computation step" is the continuation that, from the perspective of running code, would be derived from the current point in a program's execution. The term continuations can also be used to refer to first-class continuations, which are constructs that give a programming language the ability to save the execution state at any point and return to that point at a later point in the program, possibly multiple times.

View the full Wikipedia page for Continuation
↑ Return to Menu

Control flow in the context of ALGOL 58

ALGOL 58, originally named IAL, is a member of the ALGOL family of computer programming languages. It was an early compromise design soon superseded by ALGOL 60. According to John Backus:

ALGOL 58 introduced the fundamental notion of the compound statement, but it was restricted to control flow only, and it was not tied to identifier scope in the way that Algol 60's blocks were.

View the full Wikipedia page for ALGOL 58
↑ Return to Menu

Control flow in the context of Framework (computer science)

A software framework is software that provides reusable, generic functionality which developers can extend or customize to create complete solutions. It offers an abstraction layer over lower-level code and infrastructure, allowing developers to focus on implementing business logic rather than building common functionality from scratch. Generally, a framework is intended to enhance productivity by allowing developers to focus on satisfying business requirements rather than reimplementing generic functionality. Frameworks often include support programs, compilers, software development kits, code libraries, toolsets, and APIs that integrate various components within a larger software platform or environment.

Unlike a library, where user code controls the program's control flow, a framework implements inversion of control by dictating the overall structure and calling user code at predefined extension points (e.g., through template methods or hooks). Frameworks also provide default behaviours that work out-of-the-box, structured mechanisms for extensibility, and a fixed core that accepts extensions (e.g., plugins or subclasses) without direct modification.

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