# What is Program to Interface?

Write code against a contract, not a specific implementation. Swap implementations without rewriting callers.

## In real work

Program to interface: checkout depends on StorageProtocol, not S3Client, so local dev can use a fake store.

## Related terms

- [Encapsulate What Varies](https://prompthausapp.com/learn/encapsulate-what-varies.md)
- [Composition Over Inheritance](https://prompthausapp.com/learn/composition-over-inheritance.md)
- [Loosely Coupled](https://prompthausapp.com/learn/loosely-coupled.md)
- [Open-Closed Principle](https://prompthausapp.com/learn/open-closed-principle.md)
- [Dependency Inversion](https://prompthausapp.com/learn/dependency-inversion.md)

## How is this different from Googling it?

Google gives a definition. Prompthaus pairs each term with how it shows up in standups, PRs, prompts, and design reviews—then quizzes you until the word sticks. One term a day on iPhone.

- Category: Foundations
- HTML: https://prompthausapp.com/learn/program-to-interface
- App Store: https://apps.apple.com/us/app/prompthaus-ai-vocabulary/id6776314407
