straight-line code

noun
UK /ˌstreɪt laɪn ˈkəʊd/
US /ˌstreɪt laɪn ˈkoʊd/

Straight-line code is a list of instructions that a computer follows in order, one after another, without jumping around.

The teacher showed us straight-line code that adds two numbers and then prints the answer.


OTHER MEANINGS

2. A program with no loops or branches, so every instruction runs exactly once from top to bottom.

Because it had no if-statements or loops, the little script was pure straight-line code.

3. A section of a program where control flows in a single path without decisions or repetition.

The compiler optimized the straight-line code by combining several steps.

4. Code written as a simple sequence of statements rather than using functions or jumps.

For beginners, writing straight-line code first makes the logic easier to follow.