2.1.3 Thinking Procedurally Flashcards
Thinking Procedurally
Thinking procedurally : Process of making a program simpler by breaking large problem down into simpler sub problems which are easier to understand and design and solve and sub-problems can be tackled independently in parallel.
- Involves problem decomposition (Top - Down Modular Design)
Thinking Procedurally - Top - Down Modular Design
Top-down design : Involves breaking down a problem into major tasks and breaking down these major tasks into smaller sub-tasks that’re simpler to understand and sub-problems can be tackled independently.
In procedural :
- Tasks and sub tasks written as separate, self-contained subroutines using local variables that can be reused.
- Structured code used for each module (Selection, iteration and sequence only three structures used)
Advantages :
- Sub-problems can be distributed between programmers and worked on independently in parallel at the same time.
- Helps identify reusable components.
- smaller modules easier to test and maintain
- Each module is self contained so easier to debug and find errors in code
- Saves time rewriting code due to convenient reuse of subroutines / classes.