bi-06 — Broader Ideas
Mechanical enforcement over documented convention
Blink enforces its type rules three ways at once: DEPS, a presubmit script, and a clang plugin.
The lesson is not about C++.
A rule nobody can violate accidentally is worth ten rules everyone agrees with.
Your equivalents: lint rules over style guides, types over comments, a CI check over a checklist item, a builder API that makes invalid states unrepresentable. When you next write a convention document, ask what would make it mechanically checkable — and if the answer is "nothing," ask whether the convention is real.
Staged assertions
DUMP_WILL_BE_CHECK marks an invariant believed true but not yet trusted: collect field data first,
promote to fatal later. That is a deployment pattern, not a C++ one.
Apply it to any invariant you want to enforce in a running system: log-only, measure, then enforce. Turning an assertion fatal without data is how you cause the outage you were trying to prevent.
Ownership as documentation
unique_ptr, scoped_refptr, raw_ptr, Member<T> — the type answers "who owns this and how
long does it live." In languages without that vocabulary you are answering the same question in
comments, which rot.
This is worth carrying into TypeScript: a type that encodes ownership or lifecycle (Owned<T>,
Borrowed<T>, a disposable) makes a class of bug unrepresentable.
Next
Use this module as a reference while reading bi-04, bi-07, and bi-08 — not before them.
Front-loading a C++ course is three weeks that teach nothing about browsers.