[Top][All Lists]

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

[lmi-commits] [lmi] master 144422d 3/7: Prefer 'a_' prefix to '_' suffix

From: Greg Chicares
Subject: [lmi-commits] [lmi] master 144422d 3/7: Prefer 'a_' prefix to '_' suffix for formal arguments
Date: Sat, 24 Feb 2018 04:53:14 -0500 (EST)

branch: master
commit 144422d83c931c56d84103396b65abc904263e90
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Prefer 'a_' prefix to '_' suffix for formal arguments
    It is generally better to avoid decorating arguments at all. In cases
    where decoration improves clarity, e.g.:
      foo::foo(int max) : max(max) ...
    an 'a_' prefix may reluctantly be used. Never use a '_' suffix to
    distinguish arguments: that is reserved for member variables.
    As long as the '_' suffix is used for all data members and never used
    for any other purpose, the example above is naturally written thus:
      foo::foo(int max) : max_(max) ...
    and one would never think of writing any 'a_' prefix.
 census_view.cpp | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/census_view.cpp b/census_view.cpp
index c742e41..6ead701 100644
--- a/census_view.cpp
+++ b/census_view.cpp
@@ -86,8 +86,8 @@ std::string insert_spaces_between_words(std::string const& s)
 struct tn_range_variant_data
     :public wxVariantData
-    tn_range_variant_data(std::string const& value_, double min_, double max_)
-        :value(value_), min(min_), max(max_)
+    tn_range_variant_data(std::string const& a_value, double a_min, double 
+        :value(a_value), min(a_min), max(a_max)
@@ -347,8 +347,8 @@ std::string DateRenderer::DoGetValueFromEditor(wxWindow* 
 struct input_sequence_variant_data
     :public wxVariantData
-    input_sequence_variant_data(std::string const& value_, Input const* 
input_, std::string const& field_)
-        :value(value_), input(input_), field(field_)
+    input_sequence_variant_data(std::string const& a_value, Input const* 
a_input, std::string const& a_field)
+        :value(a_value), input(a_input), field(a_field)

reply via email to

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