Skip to main content

name-boolean-flags-affirmatively

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

Datos de origen

Repositorio
samugit83/cortex
Última actividad en el origen
20 de septiembre de 2026 a las 20:32
Idioma detectado de SKILL.md
inglés
Estrellas
1
Forks
0

Opciones de instalación

De forma predeterminada está seleccionado el prompt que primero revisa el origen. Puedes cambiar a un comando directo o descargar una copia local.

Revisa los archivos de origen

Lee SKILL.md y los archivos complementarios que muestra SkillsMP antes de decidir si quieres instalarlo.

Mostrando SKILL.md

SKILL.md
Instrucciones de origen · Vista previa de solo lectura
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.
Ver en GitHub