Yesterday, I re-discovered Bob Nystrom’s Long Names Are Long blog post. When he was doing code reviews at Google, he noticed a lot of code creating “identifiers that were too damn long.” So he wrote this blog post to provide guidelines on how to create better identifiers. Here’s my summary of Bob’s four rules:
- Omit words that describe the variable’s type or the method’s parameters It’s redundant to put the type in the variable’s name.