Repository navigation
Add simplicity ladder recipe and review criterion #67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
amir-yogev-gh
wants to merge
3
commits into
flightctl:main
from
amir-yogev-gh:add-simplicity-ladder-recipe
Closed
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| --- | ||
| name: simplicity-ladder | ||
| version: 0.1.0 | ||
| --- | ||
| # Recipe: Simplicity Ladder | ||
|
|
||
| A quick decision checklist for choosing the simplest viable implementation. | ||
| Referenced by code-producing workflows before writing new code. | ||
|
|
||
| ## The Ladder | ||
|
|
||
| Stop at the first rung that holds: | ||
|
|
||
| 1. **Does this need to exist?** If the requirement is already met by | ||
| existing code, or the feature is speculative — stop. YAGNI. | ||
| 2. **Stdlib does it?** Use the language's standard library. Don't wrap it. | ||
| 3. **Native platform feature?** Use it — OS API, runtime built-in, | ||
| framework primitive, HTML/CSS over JS. | ||
| 4. **Already-installed dependency?** Check existing deps before adding new | ||
| ones. Never add a dependency for what a few lines can do. | ||
| 5. **One-liner?** If the solution fits in one clear line or expression, | ||
| write the one-liner. Don't build infrastructure around it. | ||
| 6. **Minimum code that works.** Write the smallest correct implementation. | ||
| No speculative abstractions, no premature generalization. | ||
|
|
||
| The ladder is a reflex, not a research project. Two rungs work — take the | ||
| higher one and move on. | ||
|
|
||
| ## When NOT to Simplify | ||
|
|
||
| Do not simplify past correctness in these areas: | ||
|
|
||
| - **Trust boundaries** — input validation, authentication, authorization | ||
| - **Data-loss paths** — persistence, backup, transaction handling | ||
| - **Security** — cryptography, secret management, access control | ||
| - **Accessibility** — a11y requirements are not optional complexity | ||
| - **Explicitly requested features** — if the story or ticket asks for it, | ||
| build it | ||
|
|
||
| ## The `ceiling:` Comment Convention | ||
|
|
||
| When the ladder leads to a simpler approach that has a known limit, | ||
| optionally leave a `ceiling:` comment at the decision point: | ||
|
|
||
| ```text | ||
| // ceiling: >5 routes with middleware → consider a router | ||
| ``` | ||
|
|
||
| The ceiling names the condition under which the simple choice stops | ||
| being adequate. It tells future maintainers when to revisit, not how | ||
| to refactor. Only add one when the limit is non-obvious — most simple | ||
| choices don't need annotation. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.