27 lines
1.3 KiB
Markdown
27 lines
1.3 KiB
Markdown
|
|
## Comment Style
|
|||
|
|
|
|||
|
|
Write plain, direct engineering comments. Do **not** imitate the overly literary
|
|||
|
|
or cryptic comment style found in some older files in this repo.
|
|||
|
|
|
|||
|
|
- **Use standard terms:** "returns" (not "answers"), "rejects/errors" (not "refuses"),
|
|||
|
|
"resolves/looks up" (not "names/spells"), "traverses" (not "walks").
|
|||
|
|
- **Name concepts directly:** Say "trait constraints" instead of "what the code around it asks".
|
|||
|
|
- **Use normal sentences with verbs:** Start docstrings with a verb ("Checks whether...",
|
|||
|
|
"Returns...", "Resolves...") rather than cryptic noun fragments.
|
|||
|
|
- **Keep it short:** 1–2 sentences for most functions. Only add more to explain a
|
|||
|
|
non-obvious invariant or edge case. Skip comments that just restate the code.
|
|||
|
|
|
|||
|
|
Examples:
|
|||
|
|
- Bad: `/// Several answers as one: refused if any refuses, held if all hold, and otherwise not known yet.`
|
|||
|
|
- Good: `/// Combines tri-state results: Some false if any failed, Some true if all passed, else None.`
|
|||
|
|
|
|||
|
|
- Bad: `/// What a file is called, worked out from where it is.`
|
|||
|
|
- Good: `/// Module identity derived from a file's path on disk.`
|
|||
|
|
|
|||
|
|
## This package
|
|||
|
|
|
|||
|
|
- `bjo build` builds the library and the glue in `glue/`.
|
|||
|
|
- `bjo test` runs `tests/keys.bjo` (the decoder, from bytes) and
|
|||
|
|
`tests/terminal.bjo` (raw mode on a pseudo-terminal, under `script`).
|
|||
|
|
- `plan.org` has the decisions and the phases.
|