GOOD PROGRAMMING STYLE
- 1.
- Make programs easy to read and understand.
- Use comments
- Do not use tricks
- 2.
- Make programs easy to modify
- Top-down design
- Structured programming - no spaghetti code
- Self contained subroutines
- 3.
- Keep programs short BUT do not sacrifice items 1 and 2 to do so
TIPS FOR WRITING PROGRAMS
- 1.
- Think about how data will be stored in memory.
- 2.
- Think about how to process data
- 3.
- Start with big picture. Break into smaller parts until reduced to
individual instructions
- 4.
- Use names instead of numbers