From 3af6cc53d111c2622d3c5743816531a77d0c2abc Mon Sep 17 00:00:00 2001 From: Lyubo Marinov Date: Thu, 6 Apr 2017 11:45:13 -0500 Subject: [PATCH] Explain _ and UPPER_CASE naming --- doc/coding-style.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/doc/coding-style.md b/doc/coding-style.md index 161f84d23..03d75b322 100644 --- a/doc/coding-style.md +++ b/doc/coding-style.md @@ -82,3 +82,12 @@ imports in other files should use the same name. Don't define the class `Registry` in ReducerRegistry.js and then import it as `Reducers` in other files. + +* The names of global constants (including ES6 module-global constants) should + be written in uppercase with underscores to separate words. For example, + `BACKGROUND_COLOR`. + +* The underscore character at the beginning of a name signals that the + respective variable, function, property is non-public i.e. private, protected, + or internal. In contrast, the lack of an underscore at the beginning of a name + signals public API.