Traditional, structured, programming has worked well for millions of programs and billions of lines of code.
There is no reason to throw it out completely. In particular, it's worked extremely well for number crunching and data processing programs that run once and produce an answer.
Two characteristics tend to define problems that can be addressed well in a purely structured fashion:
- The data to be manipulated closely matches the built-in data types of the language, typically numbers and strings.
- The program follows a well-defined flow of control to produce a single result based on some input.
Computer programs with these characteristics include many scientific, engineering, and text processing applications and many of the "textbook examples" from traditional computer science courses. Not surprisingly, these are exactly the sorts of programs that the first people to invent programming languages wanted to solve.
Most modern programming languages are structured this way: the things in the program are objects, and most of the code in the program consists of methods that use the data stored in those objects.
A traditionally structured program usually has control over what happens when, but an event-driven program must be able to respond to input at unpredictable moments.
Structured programming can be defined as a software application programming technique that follows a top down design approach with block oriented structures. This style of programming is characterized by the programmers tendency to divide his program source code into logically structured blocks
which would normally consist of conditional statements, loops and logic blocks. This style of programming has the implementation of the source code being processed in the order in which bits of the code have been typed in