lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master c5beb52: Add a guideline for consistent class


From: Vadim Zeitlin
Subject: [lmi-commits] [lmi] master c5beb52: Add a guideline for consistent class variables naming
Date: Thu, 27 Sep 2018 17:21:44 -0400 (EDT)

branch: master
commit c5beb521469c4706bf9b8c920e74d511b720b337
Author: Vadim Zeitlin <address@hidden>
Commit: Vadim Zeitlin <address@hidden>

    Add a guideline for consistent class variables naming
    
    Document that the names of the same "thing" should be the same in all
    contexts where it appears.
---
 vz/Style-guide.md | 23 ++++++++++++++++++++++-
 1 file changed, 22 insertions(+), 1 deletion(-)

diff --git a/vz/Style-guide.md b/vz/Style-guide.md
index b25fbcd..c06e352 100644
--- a/vz/Style-guide.md
+++ b/vz/Style-guide.md
@@ -185,7 +185,28 @@ get in the way unless they're grouped at the end.
 Also, use the same order for the definitions in the implementation file, as for
 the declarations.
 
-See f6390fe69a768246deba65e5bef18a9c2f462c14
+See f6390fe69a768246deba65e5bef18a9c2f462c14.
+
+### Use consistent names for constructor arguments, accessors and variables
+
+Use exactly the same name in all of these contexts, e.g.:
+
+```cpp
+class xyzzy
+{
+  public:
+    xyzzy(some_kind_of_thing const& thing)
+        :thing_ {thing}
+    {}
+
+    some_kind_of_thing const& thing() {return thing_;}
+
+  private:
+    some_kind_of_thing thing_;
+};
+```
+
+See ee96985b83067d9a6a9219f68fa6c0a6eabbb697.
 
 
 Miscellaneous



reply via email to

[Prev in Thread] Current Thread [Next in Thread]