Prompt
Names should be semantically meaningful and properly prefixed to prevent namespace conflicts. In C, enum variants and global identifiers are added to the top-level namespace, so prefix them with their type name even if repetitive. Choose names that reflect domain concepts and purpose rather than technical implementation details. Prioritize clarity over brevity by spelling out words fully.
Examples:
- Enum values: Use
TSQuantifierOneOrMoreinstead ofOneOrMore - Struct fields: Use
shift(domain-specific) instead ofstatus(generic) - Functions: Use
ts_malloc_defaultinstead ofts_malloc_dflt - Macros: Use
SUBTREE_SIZE(semantic) instead ofSUBTREE_4_BYTES(technical)
This prevents naming conflicts, improves code readability, and makes the codebase more maintainable by clearly indicating the purpose and scope of each identifier.