Design
Design is an important step in the construction of any system. In
programming, in particular, it is essential to create a design before
attempting to code. Design helps you:
- Organize the information required for the task at hand
- Plan out how things will work, so that you can handle potential problems
A good design will:
- fulfill the goals of maintainability, extensibility, evolvability, reuse
and simplicity
- meet the requirements of the task
How do I create my design?
The thought required in the initial design process involves:
- identification of the problems
- proposal of solutions in the form of code
- analysis and selection of the best solution
What issues should I consider?
- How can I avoid duplication of tasks?
- What advanced features will I use?
- How can I implement my code using simple techniques?
- What tasks will my program perform, and how will I code them?
- What are the overall goals of my project?
What do I need to include in my design?
- Text
- Text, in the form of descriptions and definitions, are essential to the
design. All variables and functions and how they interact should be described
here in some detail. A sample run-through of the program is also a good idea,
as it demonstrates how the code is executed to provide the program's
functionality. Finally, text is used in pseudocode, which is
described next.
- Pseudocode
- Pseudocode is a high-level description of the functions that will be
needed in the program. Essentially, it describes what the code will be doing
in English, so that implementing the code will be much easier. When
writing pseudocode, you should take into consideration the potential problems
you will face, and how the code will handle these problems. Will you be using
conditionals or loops? Pseudocode should always be written for complex
procedures, and each step of code should be written at a high level.
- Diagrams
- Without a diagram, a design is not complete. Diagrams can show the
actual physical components and how they interact, and they can also demonstrate
how objects are related to one another. Diagrams can consist of flowcharts,
component relationships and user interfaces. For the JavaScript program in
particular, a diagram of the user interface (what you see on the page) is
very useful.
Good luck with your design! Remember, if a program is properly designed,
the task of writing the program becomes much easier.

HOME