[guide] Add notes on acronyms and initialisms to naming

This commit is contained in:
Jordan Gensler
2016-09-12 16:12:19 -07:00
committed by Jordan Gensler
parent c4a9d28485
commit 9f51fd264b

View File

@@ -2761,6 +2761,36 @@ Other Style Guides
export default AirbnbStyleGuide;
```
<a name="naming--Acronyms-and-Initialisms"></a>
- [22.9](#naming--Acronyms-and-Initialisms) Acronyms and initialisms should always be all capitalized, or all lowercased.
> Why? Names are for readability, not to appease a computer algorithm.
```javascript
// bad
import SmsContainer from './containers/SmsContainer';
// bad
const HttpRequests = [
// ...
];
// good
import SMSContainer from './containers/SMSContainer';
// good
const HTTPRequests = [
// ...
];
// best
import TextMessageContainer from './containers/TextMessageContainer';
// best
const Requests = [
// ...
];
```
**[⬆ back to top](#table-of-contents)**