Software engineering principles exemplified with cooking recipes August 15, 2015Posted by Ezra Resnick in Computer science.
Don’t Repeat Yourself
Add an inch or two of water to a pot. Insert a colander above the water, and bring the water to a boil. Add broccoli in bite-sized pieces. Cover the pot and cook for a few minutes, until tender.
Add an inch or two of water to a pot. Insert a colander above the water, and bring the water to a boil. Add cauliflower in bite-sized pieces. Cover the pot and cook for a few minutes, until tender.
Steam broccoli and cauliflower. (See sidebar on how to steam vegetables.)
Modularity (Low Coupling)
Push the “Start” button on the left side of the oven, then push the “plus” button until the temperature display reads 350. Wait 15 minutes. Put cookies in the oven for 27.5 minutes.
Preheat oven to 350 degrees (see oven’s instruction manual). Bake cookies for 20-30 minutes, until firm and brown.
Milk a cow, and let the fresh milk rest in a cool place for 24 hours. Skim the layer of cream off the surface and pour into a container. Shake the container for 30 minutes. Filter through a gauze to eliminate the liquid. Put into a mold and chill.
Buy some butter at the store.