Create Searchable Names
April 1, 2020 ยท View on GitHub
You will always use tools to do code lookup (grep, ack, GitHub).
Making them easier to find, increases their visibility.
Example: "unshareable" vs "unsharable"
Neither "unshareable" or "unsharable" are real English words.
unshareable:
- google (define:unshareable), nothing
- https://www.dictionary.com/browse/unshareable exists
- https://www.yourdictionary.com/unshareable Impossible to share.
- https://www.oxfordlearnersdictionaries.com/spellcheck/english/?q=unshareable does not exist
- https://www.definitions.net/definition/unshareable Impossible to share.
- my macOS says "unshareable" is a spelling mistake, without a good suggestion
- does not exist in
/usr/share/dict/words
- does not exist in
unsharable:
- google (define:unsharable), nothing
- https://www.dictionary.com/browse/unsharable exists
- https://www.yourdictionary.com/unsharable fails
- https://www.definitions.net/definition/unsharable does not exist
- my macOS says "unsharable" is legit, but if you right-click and do "Look up in Dictionary" it doesn't pull out anything
- exists in
/usr/share/dict/words
- exists in
Resolution: chose "unshareable"
- Visually looks correct
- Can be found when searching for "share"
References
- Clean Code: Meaningful Names > Use Searchable Names