Open/Closed: Sweet as Honey but Closed for Modification
Placeholder prose. A comb is extended cell by cell at its edge; nobody reopens a sealed cell to change its shape. The opening section sets up the analogy and states the principle in one sentence.
Second paragraph of placeholder body copy. It names the failure mode the principle prevents and what the regression bug looks like when it arrives.
The switch that keeps growing
Placeholder lead-in to the code sample below.
hive/dispatch.ts
function feed(bee: Bee) {
switch (bee.role) {
case "forager": return nectar(bee);
case "nurse": return jelly(bee);
// every new role edits this function
default: throw new Error("unknown role");
}
}Every edit to working code is a bet that you understood it as well as the bee who built it.
Extension at the edge
Closing placeholder paragraph. It restates the rule, concedes the one case where breaking it is fine, and hands off to the next article.