# Two-Way Doors: Don't Code Yourself into a Corner

DevFeed: [Two-Way Doors: Don't Code Yourself into a Corner](<https://devfeed.tech/articles/two-way-doors-don-t-code-yourself-into-a-corner-64815.md>)

Original publisher: [Read original article](<http://testing.googleblog.com/2026/10/two-way-doors-dont-code-yourself-into.html>)

Author: Google Testing Bloggers (noreply@blogger.com)

Published: 2026-10-05T12:47:12Z

Content type: article

Language: en

Sources: [Google Testing Blog](<https://devfeed.tech/sources/google-testing-blog.md>)

Topics: [Code Modularity](<https://devfeed.tech/topics/code-modularity.md>), [feature flags](<https://devfeed.tech/topics/feature-flags.md>), [Deployment Strategies](<https://devfeed.tech/topics/deployment-strategies.md>)

Tags: [article](<https://devfeed.tech/tags/article.md>), [chris-kennelly](<https://devfeed.tech/tags/chris-kennelly.md>), [decoupling](<https://devfeed.tech/tags/decoupling.md>), [feature-flags](<https://devfeed.tech/tags/feature-flags.md>), [nimit-khandelwal](<https://devfeed.tech/tags/nimit-khandelwal.md>), [technical-debt](<https://devfeed.tech/tags/technical-debt.md>), [tott](<https://devfeed.tech/tags/tott.md>)

## AI overview

The article explains how software teams can keep decisions reversible to move quickly without accumulating technical debt. It recommends designing in flexibility through patterns such as feature flags and limiting access to APIs that are still under development.

## Source excerpt

This article was adapted from a Google Tech on the Toilet (TotT) episode. You can download a printer-friendly version of this TotT episode and post it in your office. By Nimit Khandelwal and Chris Kennelly On large software projects, even seemingly trivial choices can set assumptions that the codebase naturally evolves around, making them incredibly expensive to fix later. To help achieve decision velocity without accumulating technical debt, leverage the "one-way vs. two-way doors" mental model: One-way doors: Decisions that are rare, highly consequential, and hard to reverse (e.g., picking a database backend). Two-way doors: Decisions that are low-risk and easy to walk back (e.g., choosing a local variable name). Unless designing for flexibility, even trivial choices can quickly harden into painful one-way doors. To maintain high decision velocity safely, use deliberate architectural patterns to engineer reversibility into your code. Instead of coding yourself into a corner, actively design your code with built-in escape hatches. By consciously building flexibility into your systems up front, you can eliminate analysis paralysis and keep your team executing both fast and safely. Here are some patterns you can use to build two-way-doors into your code: Pattern Description How It Creates a Two-Way Door Feature flags Use conditional switches within the code to safely roll out a new feature in production, decoupling deployment from release. Dynamically isolates experimental behavior from the baseline. If a new logic path fails in production, the flag update can be rolled back and the system restored to the previous, good known state. Limiting API exposure Limit access to APIs that are under development; only expand access once the design is highly mature. Restricts access to your module or package, allowing you to iterate and refactor the interface without breaking downstream clients. Reversing a public API is a painful one-way door. Decoupling data formats Keep trans