DEV Community is a community of 891,295 amazing developers

We're a place where coders share, stay up-to-date and grow their careers.

Matheus Gomes π¨βπ»

Posted on

Sup dudes, it's me again!π

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!

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.

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) and repetition (while and for), block structures, and subroutines.

Graphical representation of the three basic patterns β sequence, selection, and repetition β using NS diagrams (blue) and flow charts (green).

Practical example:

``````result = [];
for i = 0; i < length(people); i++ {
p = people[i];
if length(p.name)) > 5 {
}
}
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.

References:

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

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

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

Discussion (2)

Marcos Henrique

Awesome π€

Matheus Gomes π¨βπ»

Thanks Marcos!