Programming Paradigms: Structured
Tags: todayilearned, todayisearched, c, computerscience
Published: 2020-01-27 23:30:04

Sup dudes, it's me again!😎

Now to talk about programming paradigm, this time about the **STRUCTURED programming paradigm**.


If you are new to this article, i explain everything about the basics of programming in my previous article, this is a series of articles about this topic. Every time i learn about one i come here and write another one.

Here you can get to all of my articles of this series!

| [Programming paradigm #1](https://dev.to/matheusgomes062/programming-paradigm-2anb) |
| :----------------------------------------------------------: |
|                        You are here!                         |

So...

# What is a **Structured** Programming Paradigm?🤔


## More Technical Explanation👨‍💻:

According to **Ray Toal** (see references) structured programming paradigm is defined by a Programming with clean, goto-free, nested control structures.

What does it mean? It means that structured programming is a kind of imperative programming where control flow is defined by nested loops, conditionals, and subroutines, rather than via GOTOS. Variables are generally local to blocks (have lexical scope).

Early languages emphasizing structured programming: Algol 60, PL/I, Algol 68, Pascal, C, Ada 83, Modula, Modula-2. Structured programming as a discipline is sometimes though to have been started by a famous letter by Edsger Dijkstra entitled [Go to Statement Considered Harmful](http://david.tribble.com/text/goto.html).


## More practical explanation😋:

It's simple a advance or improvement on the clarity, quality and development time of a computer program by making extensive use of the structured control flow constructs of selection ([if/then/else](https://en.wikipedia.org/wiki/Conditional_(computer_programming))) and repetition (while and [for](https://en.wikipedia.org/wiki/For_loop)), [block structures](https://en.wikipedia.org/wiki/Block_(programming)), and [subroutines](https://en.wikipedia.org/wiki/Subroutines).

![](https://upload.wikimedia.org/wikipedia/commons/e/ec/Structured_program_patterns.png)

Graphical representation of the [three basic patterns](https://en.wikipedia.org/wiki/Structured_program_theorem) — sequence, selection, and repetition — using [NS diagrams](https://en.wikipedia.org/wiki/Nassi–Shneiderman_diagram) (blue) and [flow charts](https://en.wikipedia.org/wiki/Flow_chart) (green).


## Practical example:

```c
result = [];
for i = 0; i < length(people); i++ {
    p = people[i];
    if length(p.name)) > 5 {
        addToList(result, toUpper(p.name));
    }
}
return sort(result);
```

## In short👍

It's a advance in the early programming languages by using if/else/while/for and block structures and subroutines. 

Imagine programming in something the doesn't even have a if else statement, that was a reality a few years ago in the early beginnings of programming. That's why we need to be thankfully to Dijkstra and his hate to GOTO statements.

![](https://media.giphy.com/media/sGscqwoTe0TxC/giphy.gif)

References:

https://cs.lmu.edu/~ray/notes/paradigms/

https://en.wikipedia.org/wiki/Structured_programming

https://en.wikipedia.org/wiki/Goto#Criticism

https://cs.lmu.edu/~ray/