Program Design in Scheme
Program Design The purpose of software is to provide a useful service -- to help someone else do his job better, improve his life. Good design is more difficult than good programming. A software engineer with good design skills has more potential than a good programmer. automatic code generation (based on design documents) will gradually reduce programming How do we learn good design?
Learning Program Design Think and practice. Learn from others (read, join a project) Scheme is often used to teach program design because it encourages small, modular programs. How to Design Programs Bruegge, Object-Oriented Software Engineering: Using UML, Patterns, and Java Lethbridge, Object-Oriented Software Engineering: Practical Software Development using UML and Java : Software Specification and Design
Scheme Example: Movie Theatre profit: the theatre's profit is revenue minus cost revenue: ticket sales times ticket price cost: fixed operating costs plus pay-per-view costs sales: depend on ticket price (and movie, of course) What is the purpose of this program? What are the inputs we have control over?
Scheme Example: Movie Theatre profit: the theatre's profit is revenue minus cost revenue: ticket sales times ticket price cost: fixed operating costs plus pay-per-view costs 50,000 Baht/day + 20 Baht/view sales: depend on ticket price (and movie, of course) demand * ( 1 - sensitivity*(ticket price - 50) ) Moviedemandsensitivity "block buster" "hit" "good" "average"