Document why recipes should not have branching logic

Created on 29 May 2025, 8 days ago

Some developers want recipes to have logic built in, which is basically writing PHP in YAML.

Paraphrasing @phenaproxima below.

Recipes have to be predictable, with a guaranteed outcome. That is precisely what makes them composable. A recipe that might do one thing, or it might do another, is inherently less composable and predictable than a recipe which just does what it says.

Another metaphor I could use for this: imagine a recipe in a cookbook — let’s say for a strawberry pie. You wouldn’t see a recipe that says “do you want this pie to have a crust? If so, follow these steps here…” That would not be a pie recipe; that would be a recipe for either a pie or a cobbler, depending. Kinda frustrating to cook that.

Drupal recipes are the same way. The inputs are there so you can tweak minor details (whole-wheat flour or gluten-free flour?), not whole sections of the procedure.

📌 Task
Status

Active

Version

1.0

Component

Code

Created by

🇺🇸United States thejimbirch Cape Cod, Massachusetts

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024