lmi
[Top][All Lists]
Advanced

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

Re: [lmi] [lmi-commits] master c88b192 5/8: Rename member variables


From: Vadim Zeitlin
Subject: Re: [lmi] [lmi-commits] master c88b192 5/8: Rename member variables
Date: Sat, 28 Apr 2018 18:53:07 +0200

On Fri, 27 Apr 2018 10:52:49 -0400 (EDT) Greg Chicares <address@hidden> wrote:

GC> branch: master
GC> commit c88b192094b96f66e0ba97af2f22cf8fdab45d05
GC> Author: Gregory W. Chicares <address@hidden>
GC> Commit: Gregory W. Chicares <address@hidden>
GC> 
GC>     Rename member variables
GC> ---
GC>  wx_table_generator.cpp | 30 +++++++++++++++---------------
GC>  wx_table_generator.hpp |  2 +-
GC>  2 files changed, 16 insertions(+), 16 deletions(-)
GC> 
GC> diff --git a/wx_table_generator.cpp b/wx_table_generator.cpp
GC> index c93367c..5153a4f 100644
GC> --- a/wx_table_generator.cpp
GC> +++ b/wx_table_generator.cpp
GC> @@ -168,15 +168,15 @@ class wx_table_generator::column_info
GC>  {
GC>    public:
GC>      column_info(std::string const& header, int width)
GC> -        :header_(header)
GC> -        ,width_(width)
GC> +        :col_header_(header)
GC> +        ,col_width_(width)

 Is it really such a good idea to use column_info::col_width_ as the full
field name? I think column_info::width_ was perfectly unambiguous already
and while I understand the argument about not using common words as
identifiers to enhance grepability, I also think it shouldn't be overblown
and lead us to conclude that we should use unique but cryptic or unique but
overlong names everywhere: for better or worse, grep can't be used to
explore C++ code structure in any case, so making it easier to use it
shouldn't be the main goal.

 But if we do it like this, then I think either the variables should use
column_ prefix or the class renamed to col_info because using both prefixes
in immediate vicinity of each other is just a recipe for cognitive
dissonance.

 Regards,
VZ


reply via email to

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