From 9f51fd264b5b2bafb9f45bdebcef6732fefb241b Mon Sep 17 00:00:00 2001 From: Jordan Gensler Date: Mon, 12 Sep 2016 16:12:19 -0700 Subject: [PATCH] [guide] Add notes on acronyms and initialisms to naming --- README.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/README.md b/README.md index 63dfc192..4a844bcb 100644 --- a/README.md +++ b/README.md @@ -2761,6 +2761,36 @@ Other Style Guides export default AirbnbStyleGuide; ``` + + - [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)**