coding, graphics, web design, web development

More Coding as Cooking

Four years ago, I published a post on computational thinking entitled, Like to cook? You’ll love JavaScript.

Photo: Chefs at Work by Michael Browning on Unsplash
Chefs at Work (Photo by Michael Browning on Unsplash)

Accordingly, I was tickled to see another web developer (Linton Ye) applying a JavaScript-as-cooking metaphor: What Is Redux: A Designer’s Guide:

Imagine there’s a chef living in each component. Fetching data from servers is like sourcing all the ingredients needed to prepare dishes.

These little chefs are easy to imagine: Ye’s article includes some tasteful illustrations of the little chefs running around. State management in Redux can be pretty dry, and the chef metaphor makes this abstract concept more digestible.

As icing on the cake, Ye also serves up his take on the “real power of Redux,” i.e., the predictability it brings to application development through its rules for data and its use of pure functions.

— Edward

P.S. I was hoping to extend this culinary metaphor even further, having noticed that Redux middleware follows a currying pattern (as illustrated by this code sample from the Udacity Nanodegree Course on React and Redux by Tyler McGinnis):

const logger = (store) => (next) => (action) => {
// ...
}

Alas, “currying” is named after Haskell Curry, a mathematician, not the curry spice blend.