2.1.3 Thinking Procedurally
No description yet. This curated deck is ready for daily study.
Card preview (4)
Decomposition
• the first stage of thinking procedurally • breaking down a large complex problem into smaller more manageable subproblems which can be solved more easily • the project becomes easier to manage and can be divided between a team • top down design is one method of decomposing a problem
Decomposition example
• games can be divided into sub programs [1] • sub programs can then be programmed as subroutines [1]
Top down design
• divided problems into levels of complexity • problems are broken down into smaller sub problems until each problem is a single task and ideally a self contained module or subroutine • each sub problem can be solved using a single subroutine
Subroutine benefits
• subroutines can be developed and tested separately so they are self contained • thus each subroutine is much simpler to test and maintain [1] • subroutines can be reused to prevent duplicate code [1]