teach-ict.com logo

THE education site for computer science and ICT

2. Top-down design

Part of being able to work with a block-structure is to be able to break a larger task down into smaller ones. This is called decomposition. Often, even the smaller tasks can be broken down further into subtasks.

Continue doing this until each task is simple enough that it can be expressed as a single self-contained block. While top-down design is most useful for large programs with tens or hundreds of thousands of lines of code, it can be applied equally to smaller programs.

Another trick to use to simplify structured programs is to stick to the same few structures as much as possible, so that what you have written in one part can be easily transferred to another as necessary.