[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
a_max)
+ :value(a_value), min(a_min), max(a_max)
{
}
@@ -347,8 +347,8 @@ std::string DateRenderer::DoGetValueFromEditor(wxWindow*
editor)
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)
{
}
- [lmi-commits] [lmi] master updated (978aa53 -> af00582), Greg Chicares, 2018/02/24
- [lmi-commits] [lmi] master 144422d 3/7: Prefer 'a_' prefix to '_' suffix for formal arguments,
Greg Chicares <=
- [lmi-commits] [lmi] master c7666b9 2/7: Declare only one variable per statement, Greg Chicares, 2018/02/24
- [lmi-commits] [lmi] master 14bea80 6/7: Prefer '_' suffix to 'm_' prefix for data members, Greg Chicares, 2018/02/24
- [lmi-commits] [lmi] master ba4d186 5/7: Use documented public accessors instead of wx data members, Greg Chicares, 2018/02/24
- [lmi-commits] [lmi] master abac73a 4/7: Prefer '_' suffix to 'm_' prefix for data members, Greg Chicares, 2018/02/24
- [lmi-commits] [lmi] master 8c86c6d 1/7: Prefer '_' suffix to 'm_' prefix for data members, Greg Chicares, 2018/02/24
- [lmi-commits] [lmi] master af00582 7/7: Prefer '_' suffix to 'm_' prefix for data members, Greg Chicares, 2018/02/24