Choose names that reflect the semantic purpose and meaning rather than implementation details or arbitrary values. Use enum constants instead of string literals, select precise identifiers that clearly convey intent, and name functions/variables based on their actual purpose.
Examples:
operationName === DocumentActionType.delete
instead of operationName === 'delete'
provider_type === 'local_file'
instead of checking multiple properties when a single semantic property existshandleUpload
instead of handleImageCropped
when the function’s purpose extends beyond just cropping'sketch'
instead of technical terms like 'handDrawn'
enum LookType { Classic = 'classic', Sketch = 'sketch' }
This approach improves code readability, reduces magic strings, and makes the codebase more maintainable by clearly expressing the developer’s intent.
Enter the URL of a public GitHub repository