From p63 of the Design Pattern Slide by Peter Norvig.
It sounds like a very good advise.
Design Strategy: English Translation
- To insure that your program says what you mean:
(1) Start with English description
(2) Write code from description
(3) Translate code back to English; compare to (1)
Example: (1), (2) from a Lisp textbook (1) “Given a list of monsters, determine the number that are swarms.”
(2) See next slide
(3) “Given a list of monsters, produce a 1 for a monster whose type is swarm, and a 0 for others. Then add up the numbers.”