Learning

Core Ideas

Similar Code, Different Reasons to Change

Shared authority and similar code are different reasons to act.

Downloads

Preview and archive labels both say Registration open. The preview owner now wants an invitation; the archive must preserve its wording.

Elsewhere, badges and manifests share one organization-owned identifier rule. When that rule changes, both outputs must follow it.

Change Keep together? Why?
Preview wording No Preview and archive have separate owners and purposes.
Official identifier rule Yes Both consumers must follow the same policy.

Share the rule that is jointly owned. Keep unrelated presentation choices separate. Identical lines alone do not decide ownership.

Separate wording decisions. Preview and archive wording have separate owners and can change independently.Separate wording decisions. Preview and archive wording have separate owners and can change independently.
One shared identifier policy. Badge and manifest identifiers both follow the same official identifier policy.One shared identifier policy. Badge and manifest identifiers both follow the same official identifier policy.
Engineering Depth

Separate functions can keep preview and archive independent. A shared policy contract can serve both identifier consumers.

For the wording change, two small functions are enough:

fn preview_label() -> &'static str { "Join the workshop" }
fn archive_label() -> &'static str { "Registration open" }

Compare the change's reach:

Design Preview changes Archive changes
Both call one registration_label() Yes Yes, accidentally
Separate wording functions Yes No

Before adding a mode flag to a helper, ask which product requirement needs that shared behavior. A current boundary may justify an abstraction with one implementation; hypothetical reuse does not. CS-05.

Your Reflection

The badge layout changes. Must the identifier policy or manifest change too?

Worked Discussion

Only if the requirement changes them. Sharing the identifier rule does not make the consumers' layouts jointly owned.

Navigation