Checkpoint: What Should Change First?
The memory-safety mechanisms and the Android case now point to one practical judgment: where should a migration portfolio make its first meaningful move? The answer connects prevention with mitigation, new-code policy with legacy remediation, and security value with the difficulty of changing a live system. A useful decision does not ask whether an organization should rewrite everything. It asks which move reduces the most important risk while creating a boundary the organization can actually operate.
From safer defaults to an investment choice
The first distinction is between prevention, detection, and containment. A memory-safe language can prevent or reject important classes of invalid memory use before they become ordinary runtime behavior. Static analysis, testing, and fuzzing can detect problems that remain. Hardening, monitoring, and incident response can contain the consequences when a defect or attack gets through. These controls overlap, but they do not perform the same job.
That difference changes how a team should judge a candidate project. If a network-facing parser is repeatedly exposed to untrusted input, adding another test campaign may be useful, but moving the parser toward a model that rules out common boundary and lifetime errors could change the source of the risk. If a component cannot yet be isolated or its dependencies cannot support a new language, stronger compiler settings and safer library use may be the best available interim step. The interim step should be named as mitigation, not described as equivalent prevention.
The first investment is strongest when it changes the default without creating a larger failure surface elsewhere. A new component written in a memory-safe language may reduce the chance of new defects, but it still needs an interface that describes the data crossing into older code. A targeted rewrite may remove a concentrated source of risk, but if the migration introduces incompatible behavior or an outage, the portfolio has traded one danger for another. A decision must therefore consider both the risk removed and the conditions introduced.
The diagram is not a scoring formula. It is a guard against one-dimensional prioritization. “Easy to rewrite” is not enough if the component has little exposure. “Highly critical” is not enough if the proposed change cannot preserve its operating contract. “New code” is not enough if the team has no way to maintain the language or test the boundary. The point is to force risk and feasibility into the same decision.
In practice, the first question is not “How many lines can we convert?” It is “What failure surface are we changing?” A component that accepts untrusted input may deserve attention because a memory error there can be reached from outside the system. A component that runs at the center of an operational workflow may deserve attention because corruption or a crash has a high cost even when it is not directly exposed.