3 ms·
This is referenced(1) as a core inspiration in the preface to “How to Design Programs” but i never researched it further because i’ve found the “design recipes”
by CraigJPerry 5y ago
This is referenced(1) as a core inspiration in the preface to “How to Design Programs” but i never researched it further because i’ve found the “design recipes” approach in htdp to be pretty solid in real life problems.
1. Analyse the problem and derive appropriate data representations, write out illustrative examples
2. Write a signature for the function - what does it consume and what does it produce. Spend time to get a concise definition of the computation it performs.
3. Create some illustrative examples of what the function does
4. Outline the function
5. Fill in the gaps to complete the definition of the function
6. Tidy up by converting some of those illustrative examples into tests
There’s a further practice to this of iterative refinement - taking what you learn as you apply this process and use that info to refine what you did.
This is a pretty solid way to go about things and it’s utterly trivial to bring a colleague up to speed with what you’re doing at any step when you need a hand. The biggest gap in practice of this method that i’ve found is a lack of concern for efficiency. It’d be fairly trivial to produce an n^3 solution following these steps when an n solution exists.
I was always swayed by the “make it work, make it right, then make it fast” approach before.
(1) … Actually i just went and opened the book, the actual reference is to Michael Jackson’s method for creating COBOL programs which is the progenitor of JSP.
- DEADB17 5y agoIn the "Fundamentals"[1] course they use a table format for the design recipe that makes the correspondence between data and functions more obvious, and perhaps the JSP inspiration more evident. [1] https://course.ccs.neu.edu/cs2500f17/design_recipe.html https://course.ccs.neu.edu/cs2500f17/design_recipe.html