Nepedia
Back to Discover
Fluent Reader
💻

Structured programming

technology Maturity 11-13 Next article →

Computers follow sets of instructions to perform tasks. These instructions are known as code. In the early days, code could become very messy. Programmers often used a command called "goto" to jump between different parts of the code. This created a tangled mess often called "spaghetti code." It was very hard for people to read or fix. Structured programming was created to solve this problem. It provides a cleaner way to organize how a computer moves through instructions.

Structured program patterns
Structured program patterns

Structured programming works using three main building blocks. The first is called a sequence. This means the computer follows steps in a straight line from top to bottom. The second is selection. This lets the computer choose a path based on a specific condition. It uses keywords like "if" or "else" to make these choices. The third is iteration, which is also called repetition. This allows a block of code to run over and over again. This happens until a certain goal is reached.

Structured program patterns
Structured program patterns

This way of writing code became popular in the late 1950s. It emerged alongside languages like ALGOL 58 and ALGOL 60. A Dutch scientist named Edsger W. Dijkstra helped lead the movement. He wrote a famous letter in 1968 called "Go To Statement Considered Harmful." He actually coined the term "structured programming" himself. In 1966, a paper by Böhm and Jacopini provided a mathematical proof for these ideas. This proof showed that these three structures could express any task a computer can do.

Structured program patterns
Structured program patterns

Many important people helped develop these ideas during the 1960s and 1970s. Scientists like Robert W. Floyd, Tony Hoare, and Ole-Johan Dahl all made contributions. Even famous programmers like Donald Knuth joined the discussion. Knuth believed code should be easy to prove as correct. However, he did not always agree with getting rid of the "goto" command entirely. In 1974, he wrote a paper about using "goto" in a structured way. He argued that sometimes a direct jump could actually make code clearer.

Structured program patterns
Structured program patterns

Today, structured programming is the standard way to write software. Most high-level languages like Python, C, and Pascal use these structures. Even older languages like FORTRAN and COBOL have added them over time. It is so common now that many people do not even think about it as a special topic. It makes code easier to understand and modify for everyone. Using these clear blocks helps prevent errors and keeps programs running smoothly. It turns a messy tangle of jumps into an organized path.

Structured program patterns
Structured program patterns
414 words

Where will your curiosity go next?

Keep exploring at your chosen reading level.

🖼️ Images & Media (1)
File:Structured_program_patterns.svg
Structured_program_patterns.svg
More to explore

What is Nepedia?

A free, ad-free encyclopedia for children. Every article is written at five reading levels, so the same page works for a five-year-old and a fifteen-year-old — use the level switcher above to see this one change. No account needed to read.