Skip to main content

name-boolean-flags-affirmatively

When naming a boolean variable, parameter or attribute, phrase it affirmatively

Quellinformationen

Repository
samugit83/cortex
Letzte Quellaktivität
20. September 2026 um 20:32
Erkannte Sprache von SKILL.md
Englisch
Sterne
1
Forks
0

Installationsoptionen

Standardmäßig ist der Prompt ausgewählt, der zuerst die Quelle prüft. Sie können zu einem direkten Befehl wechseln oder eine lokale Kopie herunterladen.

Quelldateien prüfen

Lesen Sie SKILL.md und alle von SkillsMP angezeigten Begleitdateien, bevor Sie sich für eine Installation entscheiden.

SKILL.md wird angezeigt

SKILL.md
Quellanweisungen · Schreibgeschützte Vorschau
name
name-boolean-flags-affirmatively
description
When naming a boolean variable, parameter or attribute, phrase it affirmatively
# Boolean names A negated name forces the reader to undo the negation at every use. - Prefer `enabled` to `disabled`, `found` to `not_found`, `valid` to `invalid`. - A parameter that switches behaviour off should still be named for what it controls, with `False` as its value, rather than named for the absence. - Predicates that answer a question read best as `is_`, `has_` or `can_` followed by the thing being asked about. The gain is at the call site: `if enabled:` needs no second thought, and `if not disabled:` never quite does.
Auf GitHub ansehen