# Open/Closed: Add, Don't Edit

When every new grading scale means editing the grade function that the whole school trusts, each new scale risks breaking the old ones; the open/closed principle says to leave working code closed to edits and open to additions, so a new scale is a new class that keeps a promise, and the grade code never changes.

![Cheat sheet: Open/Closed: Add, Don't Edit](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/11/31954fc1c85846b590342ee33c6ac48f.webp)

- Category: Data Structures
- Level: Apprentice
- Tags: Interface, OOP, Open/Closed Principle, Polymorphism
- Author: Gregor Dzierzon
- Updated: November 17, 2026

Source: https://www.ask-codey.com/cheat-sheets/dp-open-closed-cheat-sheet
